Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum
https://www.tinywebgallery.com/forum/

Problem with my cache and naming of thumbnails
https://www.tinywebgallery.com/forum/viewtopic.php?f=4&t=1187
Page 1 of 1

Author:  Joopbraakhekke [ 12. Sep 2007, 22:12 ]
Post subject:  Problem with my cache and naming of thumbnails

Hi all!

First thing to say; what a great gallery!

I have a huge problem now and then... When I make use of the cache, sometimes my server crashes!

What exactly is the problem?

I figured this out: for every thumbnail or other file the server generates a file in its cache where every space is replaced by a + ... And here is the problem, the pages which are generated link the pictures to a file where the space is replaced with a %. So you can guess what happens; a broken link because the page is looking for example: us%on%the%beach.jpg but the file in the cache is named us+on+the+beach.jpg.
Normally not bad at all because you should say that a broken link will generate a 404. So a page where the image is white with a little red cross in the upper left corner... But instead of generating a 404, TWG keeps hitting my index.php over and over again (like every sec. a new request) till my server crashes and I have to restart the server.

Is this a bug or something else?

Grtz

Author:  TinyWebGallery [ 13. Sep 2007, 09:14 ]
Post subject: 

if you show on the properties of a file in the cache then a space should be saved as an + - thats correct.

and on the page the + should be as %2B (this is the + urlencoded). this has to be done like this because many servers don't like special chars like öäü if they are accessed directly. this is why you find many %xx in the cachenames.

TWG has a switch that is called $double_encode_urls - this is for servers that do the decode twice - this happens if there are 2 instances before that do urldecoding (this happens sometimes because of a wrong server setup).

About the reload. Do you have a .htaccess that defines a new 404 page? You should remove this then.

as final solution you can disable the direct cache calls by setting
$disable_direct_thumbs_access=true; - then the images are not accessed directly from the cache folder but returned by the image.php that reads them from the cache.

/Michael

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/