docs: def _insert_cache(self, key, val, read):
          '''
          Does an insert into the cache such that the cache
          will have an updated entry for the key,value,read
          tuple. Any changes to those values will both update
          the local cache and queue any required writes to the
          database.
          '''
          if key != None and self.stringify_keys:
              key = str(key)
          cval = self._cache.get(key)
          if cval == None:
              self._cur_size += 1
          if cval == None or val != cval:
              self._cache[key] = val
              # Force a write if it's a write or if it's
              # unclear that the item was modified
              if not self.read_only and (not self._immutable_vals or not read):
                  self._wqueue.add(key)