Cache Not Being Used

Hello and good evening

Zenphoto is amazing. It's slick, it's efficient, and it's incredibly simple to install.

So simple, that I've already started using nightly builds :)

I do have one problem however
I have two albums (must test first :) )

1 album has 15 images and they are loaded pretty quickly

The other album has 185 images
The would load quickly, but it looks like Apache is re-processing the images (for the thumbnails)

Although, cache/ is chmodded 777 and has many files in it!

I have disabled mod_rewrite, is that causing the problem? I couldn't use mod_rewrite, I think because my albums have spaces in the directory names.

I am hosting on my own personal server in my closet, so CPU power / Memory usage is not a big deal, however it is frustrating to wait a few minutes for the thumbnails to load when, I think, they should load instantly after they have been cached.

Comments

  • vraa Member
    I have been able to speed things up a tremendous amount by exporting my photos from iPhoto in reduced size
    And now the things pop up quite quickly
    But I still get the feeling that all the images are being generated on the fly and the cache isn't being used to read from
    Apache still goes to 100% cpu usage (or 200% considering it's a dual core processor, and that's between all 7 or so Apache threads) whenever I browse inside the 185 image album (thumbnails only)
    Shouldn't everything load, well almost instantly? I'm browsing it on a LAN
  • vraa Member
    It seems like I've discovered something

    For my album with 15 images, I'm pretty sure the images are cached and retrieved from the cache.

    I have set my images per page to 20

    The album with 15 images loads almost next to instantly
    However, the album with 185 images, even if I'm only displaying 20 at a page, go through loading five or so at a time.

    So I am quite certain only 1 album's thumbnails are being retrieved from the cache, is there a way I can troubleshoot / resolve this further?
  • acrylian Administrator, Developer
    So let us explain how the cache works: The images you upload are indeed processed on the fly while viewing the page and the bigger the uploaded pictures are the longer that takes. Take a look here, too: http://www.zenphoto.org/2007/12/troubleshooting-zenphoto/#11
    But this on the fly caching happens only once, so that the cache is used if all images are cached (until you change the settings for size of course).

    But you also can cache the images for the whole gallery or a specific album in the admin backend manually to avoid that.
  • vraa Member
    Is there a way to verify that
    Yes, this certain picture was processed on the fly
    and then subsequently
    Yes, this picture was loaded from the cache
  • vraa Member
    My friends, I am extremely happy!
    I am not sure what happened, but I reinstalled Zenphoto from scratch.
    Re-built the mysql database
    And now it seems like the cache is working!
    I will do further testing to make sure
    But boy, this is FAST!
  • vraa Member
    Okay :(
    I am having trouble again

    I just uploaded an archive.zip of 40mb, and let Zenphoto take care of the rest
    I precached the images
    But when I browse to the album, it's not loading from cache
    I know this because through top output, I can see multiple apache threads being spawned and my cpu usage going up
    Comparatively, if I go to another album (with more pictures as well), it loads much faster and there is much less load on my server

    I checked the /cache/ folders, I can see that the appropriate cache files are being made
    The permissions are all the same on all the folders
    I've cleared the cache and regenerated it about 10 times now and it's still not working on this latest album
    I even tried Firefox.

    I just don't know what to do.

    Edit: BTW, I also disabled eaccelerator and have restarted apache a bunch of times now
  • vraa Member
    I got it to work, but I had to copy the files to the server, and then move the files, then chown then chmod the folder
    Or something like that
  • acrylian Administrator, Developer
  • vraa Member
    Well my server isn't crashing?
    It is generating the proper cache files.
    Thanks for your help!
  • acrylian Administrator, Developer
    I was refering to this But when I browse to the album, it's not loading from cache
    I know this because through top output, I can see multiple apache threads being spawned and my cpu usage going up
    you wrote above. An overload in the processing was the only thing that came to my mind.
  • Can you post a link to your site? What are the URLs that show up on the pages?

    BTW, just because you see multiple threads does not mean that the images are not coming from the cache. Your browser will request each image as a separate request, so there will be multiple threads serving these requests.
Sign In or Register to comment.