Log in

View Full Version : TimThumb PHP Image Resizer and Cache Question



qwikad.com
09-28-2013, 10:31 PM
I am using TimThumb PHP Image Resizer: http://www.binarymoon.co.uk/projects/timthumb/ in one of my projects and I just noticed that my cache folder is full of files that have one line of php code in them: <?php die('Execution denied!'); //jpg ?>

Everything is working just fine, but every time an image is posted and viewed or just viewed a new cache file appears for that image.

Question: Is it normal?

I know cache is cleaned regularly, but I am wondering if it's going to create an issue if I have thousands of those files cached day in and day out.


Thanks!

Beverleyh
09-28-2013, 10:56 PM
if you Google "timthumb execution denied" you'll find suitable information and fixes.

qwikad.com
09-28-2013, 11:49 PM
if you Google "timthumb execution denied" you'll find suitable information and fixes.

I don't know why I didn't think of that. It looks like the <?php die('Execution denied!'); //jpg ?> was designed as a security feature. Ok, settled that one down.

The question I still need to get answered is: is having thousands of cached files going to create an issue for a server? Or is it typical and normal?

Can't find an answer to that one on my own.

Beverleyh
09-29-2013, 06:20 AM
If the cache is being emptied by the script at regular intervals, I don't imagine so. I haven't used this particular script, but I've used text replacement scripts in the past and they auto-generated images on the server in a similar fashion. The cache used to get pretty crowded but it cleansed itself every week and having the images sat there caused no harm. Once they'd been generated, they were just files like any other - of course, the auto-generation part is where the slow-down happened as the server worked harder, so there was a bit of a delay in the time it took for the replacement images to appear on the web page. But then as you'd expect, subsequent views would pull them from the cache so it would be faster.

If you want a bit of reassurance though , its probably going to be easier to ask the developer directly.

qwikad.com
09-29-2013, 12:39 PM
Thank you. This morning I researched more reg. the script. All the answers are in the script. It's smarter than I thought it was. It appears the cache will be automatically cleaned every so often.