llocally / timthumb

Automatically exported from code.google.com/p/timthumb
0 stars 0 forks source link

serverside controlled cache_max_age #193

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi there,

first of all, thank you very much for this fantastic work, which is totally 
easy to understand and to use. I've bought a wordpress-theme, which included 
your thumb.php (v1.25), so I looked up the source for your website and found 
finally an update to 1.28, which it includes the cache_max_age-Variable... yeah 
:-) BUT I need this serverside controlled.

So far it's only possible to clear the cache after a specified number of files. 
But my images are dynamically generated, and refreshes their inputs every 
single hour. So both possibilities to clear the cache are not good for my case.

Could you please integrate something like this in an future version? Thank you!

Regards
Sebastian

Original issue reported on code.google.com by Sebastia...@googlemail.com on 29 May 2011 at 6:25

GoogleCodeExporter commented 9 years ago
Options All -Indexes
Header unset Cache-Control:
Header append Cache-Control: "max-age=3600, public"

Put this in your .htaccess

Original comment by m...@maartenklok.nl on 31 May 2011 at 12:17

GoogleCodeExporter commented 9 years ago
I've already added the cache-control in the image-header, so the 
thumb.php-script will look into this and refresh the cache every single hour?

Original comment by Sebastia...@googlemail.com on 31 May 2011 at 6:48

GoogleCodeExporter commented 9 years ago
Thanks for the feedback. I've modified timthumb so that cache is purely time 
based now. Having it time based as well as number of files based was confusing. 
Also number of files is meaningless if you don't know their size. 

Also changed cacheClean routine to be at start of execution so that the first 
visitor after FILE_CACHE_TIME_BETWEEN_CLEANS expires doesn't see a stale image.

Original comment by mmaun...@gmail.com on 7 Aug 2011 at 1:49

GoogleCodeExporter commented 9 years ago
Wow, thx for your great work and for the including.

Original comment by Sebastia...@googlemail.com on 16 Aug 2011 at 10:56