WordPress.org

Ready to get started?Download WordPress

Forums

Tim Thumb Cache Control (3 posts)

  1. serpico
    Member
    Posted 4 years ago #

    Hi Guys,

    Looking for a bit of advice. I have quite heavily used timthumb on my new website to control image sizes.

    Every time an image is requested in a specific size it is cached and that image is saved in the cache folder on the server for future requests of that image to be delivered from. Correct? How long will this cache last for?

    I ask because, my site is running quite slow while each of those cached image files is being created. Once a the images for a page has been cached the page reloads nice and quick. When each of these cached images is created will they last forever or will they have to be recreated at some point?

    I basically want that image to last forever, once it has been cached.

    If the cache only has a certain life span, could I write a script which prints to screen the html <img> tag generate all the tim thumb thumbnails in order to re-create the cache. Then have this script run on a cron job. Would the cron actually generate the cache even though nothing is rendered in a browser?

  2. serpico
    Member
    Posted 4 years ago #

    In case anyone else needs the answer to this, the top of the timthumb.php code has these definable variables;

    define ('CACHE_SIZE', 5000);					// number of files to store before clearing cache
    define ('CACHE_CLEAR', 1);					// maximum number of files to delete on each cache clear
  3. Arash
    Member
    Posted 3 years ago #

    Yet it does not use the cache, but keeps on regenerating everything for every user. No using the cache!

    Yet it does create files in the cache, just doesn't use them.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags