Store the cache data in APC
348749
public function store($key, $data, $lifetime = 0)
    {

        $key = $this->namespace . $key;

        $store = apc_store($key, $data, $lifetime);
        if ($store && $key != $this->namespace . $this->catalog_key) {
            $this->catalogKeyAdd($key, $lifetime);
        }
        return $store;
    }
353927
def save_cache(data, filename):
    """"""
    with open(filename, 'wb') as handle:
        pickle.dump(data, handle)
1139577
def save_output_in_cache(name, filename, output):
    
    cache_filename = _get_cache_filename(name, filename)
    with _open_for_write(cache_filename) as f:
        f.write(output)
619845
def cache_context(self, context):
        '''
        
        '''
        if not os.path.isdir(os.path.dirname(self.cache_path)):
            os.mkdir(os.path.dirname(self.cache_path))
        with salt.utils.files.fopen(self.cache_path, 'w+b') as cache:
            self.serial.dump(context, cache)
1034715
protected synchronized void serializeCacheMapping() {
		for (Map.Entry<String, List<FilePathMapping>> entry : linkedResourceMap.entrySet()) {

			StringBuilder strb = new StringBuilder();
			Iterator<FilePathMapping> iter = entry.getValue().iterator();
			if (iter.hasNext()) {

				for (; iter.hasNext();) {
					FilePathMapping fMapping = iter.next();
					strb.append(fMapping.getPath()).append(MAPPING_TIMESTAMP_SEPARATOR)
							.append(fMapping.getLastModified());
					if (iter.hasNext()) {
						strb.append(SEMICOLON);
					}
				}
				cacheProperties.put(JAWR_MAPPING_PREFIX + entry.getKey(), strb.toString());
			}
		}

		File f = new File(getCacheFilePath());
		if (!f.getParentFile().exists()) {
			f.getParentFile().mkdirs();
		}
		FileWriter fw = null;
		try {
			fw = new FileWriter(f);
			cacheProperties.store(fw, "Cache properties of " + getName() + " generator");
		} catch (IOException e) {
			throw new BundlingProcessException("Unable to save cache file mapping ", e);
		} finally {
			IOUtils.close(fw);
		}
	}
802400
def write_to_cache(self, data, filename=''):
        '''  '''
        if not filename:
            filename = self.cache_path_cache
        json_data = json.dumps(data)
        with open(filename, 'w') as cache:
            cache.write(json_data)
        return True
275588
def cache_data(datatable, data, **kwargs):
    
    cache_key = '%s%s' % (CACHE_PREFIX, datatable.get_cache_key(**kwargs))
    log.debug("Setting data to cache at %r: %r", cache_key, data)
    cache.set(cache_key, data)
35082
private function _write_cache()
    {
        if (is_writable(dirname(dirname(dirname(__DIR__))).'/cache')) {
            @file_put_contents($this->_cache_file, $this->_use_json ?
                json_encode(array(
                    'hw' => array(
                        'pci' => $this->_pci_devices,
                        'usb' => $this->_usb_devices,
                    ),
                ))
                : serialize(array(
                    'hw' => array(
                        'pci' => $this->_pci_devices,
                        'usb' => $this->_usb_devices,
                    ),
            )));
        }
    }
1362736
def store(self, loc, df):
        

        path = "%s.%s" % (self._root / "processed" / loc, FILE_EXTENSION)
        WRITE_DF(df, path, **WRITE_DF_OPTS)
        self._cache[loc] = df
911869
def cache(self):
      """"""
      msg = 'Saving updates from more recent "%s" to "%s"'
      log.info(msg, self.filename, self.cachename)
      with open(self.cachename, 'wb') as output:
          cPickle.dump(self._dict, output, -1)
901519
function store()
    {
        if ( !$this->IsModified )
        {
            return;
        }

        // EZP-23908: Restore timestamps before saving, to reduce chance of race condition issues
        $modifiedTimestamps = $this->Timestamps;
        $this->restore();

        // Apply timestamps that have been added or modified in this process
        foreach ( $modifiedTimestamps as $name => $value )
        {
            if ( $value > self::getTimestamp( $name, 0 ) )
            {
                $this->setTimestamp( $name, $value );
            }
        }

        if ( $this->IsModified )
        {
            $this->CacheFile->storeContents( "<?php\n\$Timestamps = " . var_export( $this->Timestamps, true ) . ";\n?>", 'expirycache', false, true );
            $this->IsModified = false;
        }
    }
524732
def savecache(apicache, json_file):
    
    if apicache is None or apicache is {}:
        return ""
    apicachestr = json.dumps(apicache, indent=2)
    with open(json_file, 'w') as cache_file:
        cache_file.write(apicachestr)
    return apicachestr
139780
def write(self):
        
        io.debug("Storing cache '{0}'".format(self.path))
        with open(self.path, "w") as file:
            json.dump(self._data, file, sort_keys=True, indent=2,
                      separators=(',', ': '))
711557
def _load_cache(self):
        """"""
        if not self._disable_cache and os.path.exists(self._cache_path):
            _LOGGER.debug("Cache found at: %s", self._cache_path)
            loaded_cache = UTILS.load_cache(self._cache_path)

            UTILS.update(self._cache, loaded_cache)

        self._save_cache()
973751
def cache(cache_directory_path):
    """"""
    if not cache_directory_path:
        click.secho(dtool_config.utils.get_cache(
            CONFIG_PATH,
        ))
    else:
        click.secho(dtool_config.utils.set_cache(
            CONFIG_PATH,
            cache_directory_path
        ))
310979
def _save_cache(self):
        """"""
        if not self._disable_cache:
            UTILS.save_cache(self._cache, self._cache_path)
1363979
public function opcacheresetAction() {
        $this->_helper->viewRenderer->setNoRender(true);
        $output = array();

        if (function_exists('opcache_reset')) {
            $result = opcache_reset();
            $output[] = $result ? 'Opcache was reset' : 'Opcache reset failed';
        }

        if (function_exists('apc_clear_cache')) {
            // Always returns true
            apc_clear_cache(); 
            $output[] = 'APC Opcache cleared';
        }

        if (!$output) {
            'No Opcache or APC cache present.';
        }

        echo implode('<br>', $output);
    }