The strangest cache problem (I think)

Hi everyone,

I'm having a strange problem -- whether or not thumbnails are cached is apparently dependent on the type of source image.

Example: http://www.thatvideogameblog.com/galleries/index.php?album=prototype
The thumbs on Page 1 and the first half of Page 2 seem to regenerate themselves each time the page is viewed, while the thumbs on the second half of Page 2 and Page 3 are loading properly.

Now, these are images of two different games that I put into one gallery. If I separate them, then one gallery will load fine (the second half) and the first one always seems regenerate the thumbs each time the page is viewed. Images from both are have been previously resized and saved in Photoshop in the same way.

I'm going crazy over here with this. Help?

Comments

  • Some additional info: Using a fresh installation (done this three times now), the latest version of ZenPhoto, and tried all the different settings in the backend (html cache plugin, mod_rewrite on/off), cache folders are all CHMOD 777, tried caching the album etc..

    This issue is the only thing preventing me from starting using ZenPhoto, and unfortunately it's a biggie..
  • acrylian Administrator, Developer
    I took a quick look and it seems indeed to generate the thumbs for some images every time. Actually I have no idea maybe some of my collegues has.
    But nevertheless please post a few more details of your setup like php version, mysql, server system. Your site itself seems a little slow to me, too (but that is probably all that flash stuff..)

    You additionally could try the nightly build to see if that changes anything.
  • Yeah, the resource-heavy flash ads currently on the front page are making browsers crawl. It's the advertiser's first campaign ever and all that. But that's beyond the point as there's a clear difference with the thumbs in the gallery where there's a barebone ZenPhoto installation.

    Here's some info:

    * Operating System : Linux
    * Server : LiteSpeed
    * MYSQL Version : 5.0.67-log
    * PHP Version : 5.2.6
    * PHP Safe Mode : Off
    * PHP Memory Limit : 32M
    * PHP Exif support : Yes ( V1.4 )
    * PHP IPTC support : Yes
    * PHP XML support : Yes

    Thanks for the help.
  • There are only two things which would prevent the images from being cached. The first is unlikely--that the image size was such that no sizing is needed. The second is some kind of error in resizing the imate or writing it to the cache. These errors should be recorded in your CGI log. What does it have to say?

    You can also do some debugging--in functions-basic.php look for the `DEBUG_IMAGE` define and change its value to true. This will cause a debug_log.txt file to be written in you zp-core folder. In it you will find the record of the image processing. I suggest you do this from an image page and that you browse to the page, then delete the debug_log.txt file, then refresh the page. Otherwise you will have quite a lot of data recorded for all the thumbnails.
  • Ok, this is strange -- the caching seems to work perfectly now on the two galleries I made yesterday. Added another two galleries just now to test how those run and the problem is back with them. I'll keep an eye on them and see if maybe by tonight they too are cached.

    But in the meanwhile, I did the DEBUG_IMAGE thing and here's what it recorded on one of the new galleries I just created:

    `
    cacheImage($imgfile=ProjectOrigin-918.jpg, $newfilename=/fear-2-projet-origin/ProjectOrigin-918.jpg_595.jpg, $allow_watermark=1, $force_cache=, $theme=default) $size=595, $width=, $height=, $cw=, $ch=, $cx=, $cy=, $quality=85, $thumb=, $crop=
    cacheImage:ProjectOrigin-918.jpg: $size=595, $width=, $height=, $cw=, $ch=, $cx=, $cy=, $quality=85, $thumb=, $crop=, $newh=446, $neww=595, $hprop=446, $wprop=793, $dim=595, $ratio_in=, $ratio_out=
    cacheImage:no crop ProjectOrigin-918.jpg:$size=595, $width=, $height=, $dim=595, $wprop=793, $hprop=446, $neww=595; $newh=446; $quality=85, $thumb=, $crop=, $rotate=
    `
    But how/where do I access my CGI logs?

    Thanks.
  • You will have to ask your ISP the question of how to view your GCI logs. Most have a link somewhere on their user operations pages.

    Do you have watermarking enabled? If so, then I can tell you that zenphoto failed at resizing the image which is almost always a memory limitation problem. What are the dimensions of your images?
  • I will ask my host about the CGI logs and report back.

    However, watermarking is NOT enabled.
    The original images are 1024x572 or 1280x728 (or somewhere between or very near to those sizes).
  • Ok, I've managed to track down the issue some more. The thumbnail regenerating occurs only when uploading the images in a zip file. I uploaded the same exact images twice -- once as a zip file, and the other time one by one. When in a zip, the thumbs regenerate each time they're viewed, but when uploaded one by one, then they function properly.

    I had "Enable Persistent Archives" enabled when I just uploaded the zip file, and the thumbs still regenerate each time they're viewed whether that option is on or off.

    I have ~8000 images to move over to Zenphoto, and I was kinda planning on zipping them :)
    Where to go from here?
  • acrylian Administrator, Developer
    Not that I have any idea to the general issue. But regarding the "Enable Persistent Archives" options: That actually does not refer to uploading of zip files. It refers to the options theme function to allow downloads of an album's images as a zip file. If enabled the zip is not generated new if requested. Perhaps that text is not clear enough about that.
  • Thanks for that explanation. Yeah, that could be worded a bit differently in the backend.

    But I'm gonna give another update -- the thumbs for the images I uploaded as a zip file around 10-12 hours ago are now working as they should and load very fast. So it seems there's some odd delay when uploading images in zips. I just uploaded another 2 galleries to confirm for a 3rd time -- the images I uploaded as separate files load fine, but the ones uploaded in a zip once again regenerate the thumbs each time a gallery page is viewed. I'm willing to bet they'll be fine in another 10-12 hours, but do you guys have any idea what could be causing this delay?
  • We will look into it. However, with so many images maybe you should consider FTP to upload them. That is probably simpler and obviates the need to zip them.
  • There seems no reason why files uploaded as zip archives would behave any differently from any other. They are just unziped into the folder after the zip file is uploaded.

    Maybe this has something to do with the lightspeed server.
  • Thanks for the help guys. I will FTP the collection and just use single upload to update them. The need to upload more than 10 images at a time rarely comes up anyway, and when it does, I can bare through it thanks to the awesomeness of Zenphoto :)
Sign In or Register to comment.