Title: Cache files
Last modified: August 21, 2016

---

# Cache files

 *  [jlcoleman71](https://wordpress.org/support/users/jlcoleman71/)
 * (@jlcoleman71)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/cache-files/)
 * I realize that the cache files located in the cache directory for the plugin 
   would be to help speed up load times for posts, but is there a way to shut this
   feature off?
 * If you add LOTS of posts looking at LOTS of different apps from the appstore,
   a ton of files are generated……..if I simply delete these cache files will they
   automatically be regenerated? Also, if they are deleted, will the plugin stop
   working?
 * I’m running into a problem with having too many files on my file server and the
   biggest culprit appears to be this plugin and the cache files it creates…….it
   works great, but I need to cut down on the number of files on the server and 
   was hoping to delete these cache files, even if it means that the posts will 
   load a little slower.
 *  Thanks
 * [http://wordpress.org/plugins/appstore-lookup/](http://wordpress.org/plugins/appstore-lookup/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Adam D](https://wordpress.org/support/users/adamdionne/)
 * (@adamdionne)
 * [12 years, 4 months ago](https://wordpress.org/support/topic/cache-files/#post-4474499)
 * The image caches can be turned off in settings by deselecting TimThumb. This 
   will slow down page loads, but that is the only impact. HOWEVER, Apple’s API 
   has a request limit, after which they will temporarily block you. This is why
   the caching of that request data [the ones that start with asl_####] happens 
   by default and doesn’t have an option to be turned off in the plugin.
 * If you delete the cache files (or indeed the entire cache folder) everything 
   will work just fine, but they will be regenerated as visitors come to the site,
   which is not what you are wanting.
 * That said:
 * If you really want to turn off the API caching, and you’re willing to deal with
   periodic outages if your site hits the request limit, you can go into asl.php
   at line 403 and replace this:
 *     ```
       function asl_get_content($url) {
   
       	// add cache directory if not exists
       	$cacheDir = dirname(__FILE__).'/cache';
   
       	 if($cacheDir){
       			if(! is_dir($cacheDir)){
       				@mkdir($cacheDir);
       				if(! is_dir($cacheDir)){
       					$this->error("Could not create the file cache directory.");
       					return false;
       				}
       			}
       	 }
   
       	//vars
       	$mins = asl_setting('json_cache');
       	$cache = dirname(__FILE__).'/cache/asl_'.md5($url).'.txt';
       	$current_time = time(); $expire_time = $mins * 60; $file_time = @filemtime($cache);
       	//do we use the cache or the file?
       	if(file_exists($cache) && ($current_time - $expire_time < $file_time)) {
       		//echo 'returning from cached file';
       		return file_get_contents($cache);
       	}
       	else {
       		$content = asl_fopen_or_curl($url);
       		file_put_contents($cache, $content);
       		return file_get_contents($cache);
       	}
       }
       ```
   
 * with the much simpler:
 *     ```
       function asl_get_content($url) {
       		$content = asl_fopen_or_curl($url);
       		return file_get_contents($content);
       }
       ```
   
 * If your site gets a lot of traffic and makes a lot of requests, you may see temporary
   issues where you won’t get app data.

Viewing 1 replies (of 1 total)

The topic ‘Cache files’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/appstore-lookup.svg)
 * [AppStore Lookup for Wordpress](https://wordpress.org/plugins/appstore-lookup/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/appstore-lookup/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/appstore-lookup/)
 * [Active Topics](https://wordpress.org/support/plugin/appstore-lookup/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/appstore-lookup/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/appstore-lookup/reviews/)

## Tags

 * [api](https://wordpress.org/support/topic-tag/api/)
 * [App Store](https://wordpress.org/support/topic-tag/app-store/)
 * [Apple](https://wordpress.org/support/topic-tag/apple/)
 * [Apps](https://wordpress.org/support/topic-tag/apps/)

 * 1 reply
 * 2 participants
 * Last reply from: [Adam D](https://wordpress.org/support/users/adamdionne/)
 * Last activity: [12 years, 4 months ago](https://wordpress.org/support/topic/cache-files/#post-4474499)
 * Status: not resolved