<?xml version="1.0" encoding="UTF-8"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>PHP Thumb Topic: How does caching work?</title>
<link>http://phpthumb.gxdlabs.com/forums/</link>
<description>Help, Suggestions, and General Discussion</description>
<language>en</language>
<pubDate>Tue, 07 Feb 2012 11:52:02 +0000</pubDate>

<item>
<title>Ian on "How does caching work?"</title>
<link>http://phpthumb.gxdlabs.com/forums/topic/how-does-caching-work#post-93</link>
<pubDate>Wed, 26 Aug 2009 16:12:51 +0000</pubDate>
<dc:creator>Ian</dc:creator>
<guid isPermaLink="false">93@http://phpthumb.gxdlabs.com/forums/</guid>
<description>&#60;p&#62;Wrong PHP Thumb library my friend :)
&#60;/p&#62;</description>
</item>
<item>
<title>robbrandt on "How does caching work?"</title>
<link>http://phpthumb.gxdlabs.com/forums/topic/how-does-caching-work#post-92</link>
<pubDate>Wed, 26 Aug 2009 15:54:57 +0000</pubDate>
<dc:creator>robbrandt</dc:creator>
<guid isPermaLink="false">92@http://phpthumb.gxdlabs.com/forums/</guid>
<description>&#60;p&#62;It seems that when I update an original file (larger, same location and name) phpthumb continues to display the original file.  I have refreshed my browser, even done &#34;view image&#34; to isolate it from the page and refreshed (which usually works in Firefox) but it's still the original.  Only when I delete the folders inside of phpThumb/cache/ do the new versions show up.&#60;/p&#62;
&#60;p&#62;The configuration options seem to suggest that they should be re-caching if the original has changed.  The cache settings for phpThumb.config.php are:&#60;/p&#62;
&#60;p&#62;// * Cache directory configuration (choose only one of these - leave the other lines commented-out):&#60;br /&#62;
// Note: this directory must be writable (usually chmod 777 is neccesary) for caching to work.&#60;br /&#62;
// If the directory is not writable no error will be generated but caching will be disabled.&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/';                            // set the cache directory relative to the phpThumb() installation&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_directory'] = $PHPTHUMB_CONFIG['document_root'].'/phpthumb/cache/'; // set the cache directory to an absolute directory for all source images&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_directory'] = './cache/';                                           // set the cache directory relative to the source image - must start with '.' (will not work to cache URL- or database-sourced images, please use an absolute directory name)&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_directory'] = null;                                                 // disable thumbnail caching (not recommended)&#60;br /&#62;
//if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {&#60;br /&#62;
//	$PHPTHUMB_CONFIG['cache_directory'] = dirname(__FILE__).'/cache/'; // set the cache directory to an absolute directory for all source images&#60;br /&#62;
//} else {&#60;br /&#62;
//	$PHPTHUMB_CONFIG['cache_directory'] = '/tmp/persistent/phpthumb/cache/';&#60;br /&#62;
//}&#60;/p&#62;
&#60;p&#62;$PHPTHUMB_CONFIG['cache_disable_warning'] = true; // If [cache_directory] is non-existant or not writable, and [cache_disable_warning] is false, an error image will be generated warning to either set the cache directory or disable the warning (to avoid people not knowing about the cache)&#60;/p&#62;
&#60;p&#62;$PHPTHUMB_CONFIG['cache_directory_depth'] = 4; // If this larger than zero, cache structure will be broken into a broad directory structure based on cache filename. For example &#34;cache_src012345...&#34; will be stored in &#34;/0/01/012/0123/cache_src012345...&#34; when (cache_directory_depth = 4)&#60;/p&#62;
&#60;p&#62;// * Cache culling: phpThumb can automatically limit the contents of the cache directory&#60;br /&#62;
//   based on last-access date and/or number of files and/or total filesize.&#60;/p&#62;
&#60;p&#62;//$PHPTHUMB_CONFIG['cache_maxage'] = null;            // never delete cached thumbnails based on last-access time&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_maxage'] = 86400 * 30;        // delete cached thumbnails that haven't been accessed in more than [30 days] (value is maximum time since last access in seconds to avoid deletion)&#60;/p&#62;
&#60;p&#62;//$PHPTHUMB_CONFIG['cache_maxsize'] = null;           // never delete cached thumbnails based on byte size of cache directory&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_maxsize'] = 10 * 1024 * 1024; // delete least-recently-accessed cached thumbnails when more than [10MB] of cached files are present (value is maximum bytesize of all cached files)&#60;/p&#62;
&#60;p&#62;//$PHPTHUMB_CONFIG['cache_maxfiles'] = null;          // never delete cached thumbnails based on number of cached files&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_maxfiles'] = 200;             // delete least-recently-accessed cached thumbnails when more than [200] cached files are present (value is maximum number of cached files to keep)&#60;/p&#62;
&#60;p&#62;// * Source image cache configuration&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_source_enabled']   = false;                               // if true, source images obtained via HTTP are cached to $PHPTHUMB_CONFIG['cache_source_directory']&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_source_directory'] = dirname(__FILE__).'/cache/source/';  // set the cache directory for unprocessed source images&#60;/p&#62;
&#60;p&#62;// * cache source modification date configuration&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_local']  = false; // if true, local source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_source_filemtime_ignore_remote'] = true;  // if true, remote source images will not be checked for modification date and cached image will be used if available, even if source image is changed or removed. WARNING: cached performance MUCH slower if this is set to false.&#60;/p&#62;
&#60;p&#62;// * Simplified cache filename configuration&#60;br /&#62;
// Instead of creating unique cache filenames for all parameter combinations, create &#34;simple&#34; cache files (eg: &#34;pic_thumb.jpg&#34;)&#60;br /&#62;
// If cache_default_only_suffix is non-empty, GETstring parameters (except 'src') are ignored and only $PHPTHUMB_DEFAULTS&#60;br /&#62;
// parameters (set at the bottom of phpThumb.config.php) are used for processing.&#60;br /&#62;
// The '*' character MUST be used to represent the source image name&#60;br /&#62;
$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '';           // cached in normal phpThumb manner&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = '*_thumb';  // cache 'pic.jpg' becomes 'pic_thumb.jpg' (or 'pic_thumb.png' if PNG output is selected, etc)&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_default_only_suffix'] = 'small-*';  // cache 'pic.jpg' becomes 'small-pic.jpg' (or 'small-pic.png' if PNG output is selected, etc)&#60;/p&#62;
&#60;p&#62;$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache_'.str_replace('www.', '', @$_SERVER['SERVER_NAME']);&#60;br /&#62;
//$PHPTHUMB_CONFIG['cache_prefix'] = 'phpThumb_cache';                         // allow phpThumb to share 1 set of cached files even if accessed under different servername/domains on same server&#60;/p&#62;
&#60;p&#62;$PHPTHUMB_CONFIG['cache_force_passthru'] = true;  // if true, cached image data will always be passed to browser; if false, HTTP redirect will be used instead
&#60;/p&#62;</description>
</item>

</channel>
</rss>

