zenphoto forums » Usage Support

Static HTML Cache plugin

(26 posts)

Tags:

  1. qb84

    Member
    Joined: May '12
    Posts: 26

    I upgraded to the newest BETA version (bad idea :( ) to try the new option to pre-cache images. Now the static HTML cache plugin doesn't seem to be working at all. I tried disabling it and enabling it and even tried installing another copy and it when I look at the HTML code, the cache comment doesn't show up. (I'm not logged in as admin either).

    Anyone else having this issue?

    Useful Info:
    -----------------
    Zenphoto version 1.4.3-BETA [10366] (Official build)
    PHP version: 5.4.4
    Graphics support: PHP GD library bundled (2.0.34 compatible)
    supporting: gif, jpg, jpeg, png, bmp
    MySql version: 5.5.25

    Posted 10 months ago #
  2. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    It is working fine here. But maybe your page has some "uncachable" items on it. For instance, if the page has references to the image processor (i.php links) it will not cache. So until those images are cached you won't get a html cache of the page. This is to prevent running the i.php script forever because the page was cached with that link.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  3. qb84

    Member
    Joined: May '12
    Posts: 26

    I was able to downgrade using my backup files and it is working again. The items are the same so probably something else is wrong with the BETA version. :(

    Posted 10 months ago #
  4. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,341

    Please check if you have the static cache option "Static HTML cache expire" set. If that is empty it seems not to work. (makes sense that the cache is not used if the time frame is none).

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  5. qb84

    Member
    Joined: May '12
    Posts: 26

    that's the first place I checked :). When I installed the fresh copy though it was empty. Setting it didn't help.

    Posted 10 months ago #
  6. qb84

    Member
    Joined: May '12
    Posts: 26

    I installed the latest release 1.4.3 and I'm having the same issue but I noticed that indeed there are some images that use i.php.

    I'm using the class-anyFile plugin and it seems that this plugin does not cache images. It creates the cached image but it does not load it once you refresh the page (the src=i.php?...).

    Now I have a question, what changed from 1.4.2 -> 3? I was able to cache everything using 1.4.2 but I can't with .3.

    Any other ideas? :(

    Update:
    -------
    I replaced the static_html_cache.php file with the old one and now it's working again (the HTML cache not the anyClass cache)

    Posted 10 months ago #
  7. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    What "image" is it that is not being fetched from the cache?

    With the older static cache plugin the page would be cached but the image not, it would always run the image processor no matter what.

    BTW, it is really not recommended that you mix and match files from different releases. No telling what problems that can cause.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  8. qb84

    Member
    Joined: May '12
    Posts: 26

    Ok this is what I've noticed.

    I have some files (CR2, DNG etc) that I import using the anyFile plugin. (I don't need a preview just a generic icon). When I look at the HTML source code the image src links to i.php?... instead of the cached file.

    for example:

    <img src="/gallery/zp-core/i.php?a=Others/Image/cr2&i=_%7Bplugins%7D_%7Bclass-AnyFile%7D_cr2Default.png&w=420&h=200&c=1&cw=420&ch=200&q=75&t=1&wmk=!" alt="IRS_Agents" class="remove-attributes">

    When I visit this link directly the i.php file redirects me to:

    /gallery/cache/Others/Image/cr2/_%7Bplugins%7D_%7Bclass-AnyFile%7D_cr2Default_w420_h200_cw420_ch200_thumb.png

    So, yes... it creates the cache file, but instead of loading it, it keeps re-creating it?

    In the meantime, I decided to downgrade (once again).

    :(

    Posted 10 months ago #
  9. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Well, of course the problem is not that the page does not get cached, that is as it should be since the image URI is to the image processor. The problem is that the image is not being fetched from the cache.

    What pages does this happen on?

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  10. qb84

    Member
    Joined: May '12
    Posts: 26

    It happens on all the pages where the album cover is a generated by the anyFile plugin.

    Posted 10 months ago #
  11. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Sorry, wha is an "album cover". This is not a Zenphoto term.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  12. qb84

    Member
    Joined: May '12
    Posts: 26

    album/folder thumbnail.

    Posted 10 months ago #
  13. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Thanks. Found the issue. Will be fixed in tonights nightly build.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  14. qb84

    Member
    Joined: May '12
    Posts: 26

    Awesome! This is why I like Zenphoto. Great people behind it :)

    Posted 10 months ago #
  15. Zenphoto development team
    acrylian

    Developer
    Joined: Jul '07
    Posts: 13,341

    Thanks ;-)

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  16. qb84

    Member
    Joined: May '12
    Posts: 26

    I tried both zenphoto-2012-07-04-development/trunk but pages with anyFile thumbnails are still not being cached :(.

    Both say build # 10413 so I'm guessing they are the same.

    update:
    ------
    I know it is not recommended but using the old static_html (from 1.4.2) seems to work correctly.

    Posted 10 months ago #
  17. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Look at the html of the page. There probably still is an i.php reference. That is what needs to be corrected.

    Caching the page with this reference will leave most of the overhead you are trying to save.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  18. qb84

    Member
    Joined: May '12
    Posts: 26

    How can I "correct" it? The anyFile plugin is not caching the generic thumbnail, and the static-html (1.4.3) plugin is not caching the HTML page. Using static-html 1.4.2 caches the page and even though it is not caching the thumbnail it loads way faster than having to create the page from scratch.

    Posted 10 months ago #
  19. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    We have to fix whatever is wrong. Based on your initial information I did find that the "default" thumbnails were not properly detected as having been cached. That is fixed. But maybe there is still some other similar problem. So I need to know what image is not being found to have been cached.

    Again, I caution you from using mixed environment scripts. You may think it works, but you will not know until it does fail.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  20. qb84

    Member
    Joined: May '12
    Posts: 26

    ok, I have a different thumbnail for each file type (CR2, EPS, DNG) saved under the zp-core\zp-extensions\class-AnyFile\ directory. Am I doing this correctly? :)

    Posted 10 months ago #
  21. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Yes the fix should not matter what the thumbnail is.

    Did you install from the trunk nightly build? The dev build would not necessarily have the fix. Right now we are pretty lax in trying to keep the dev build up to date as all attention is on the trunk/release 1.4.3 builds.

    So maybe install again from last night's trunk build to be sure the fix is present. If it still does not work report again what i.php script calls are present.

    Also, maybe clear the image cache. Be sure that you reload the page at least once before checking.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  22. qb84

    Member
    Joined: May '12
    Posts: 26

    I always clear the browser and static html cache before I test.

    Right now I just installed trunk build: 10413.

    Sample of CR2 Thumbnail code.

    <img src="/gallery/zp-core/i.php?a=JohnSmith/cr2&i=_%7Bplugins%7D_%7Bclass-AnyFile%7D_cr2Default.png&w=420&h=200&c=1&cw=420&ch=200&q=75&t=1&wmk=!" alt="John Smith">

    :(

    Posted 10 months ago #
  23. qb84

    Member
    Joined: May '12
    Posts: 26

    ok.. I think I found the issue. I'm using the ZPSkeleton Theme. I tried the default theme and the image is cached. So my guess is that the printCustomAlbumThumbImage function is not caching anyFile thumbnails.

    Posted 10 months ago #
  24. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Yes, that is it. Have to figure out how to fix it, though.

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  25. Zenphoto development team
    sbillard

    Chief Developer
    Joined: May '07
    Posts: 9,766

    Fix in tonight's nighly (trunk)

    Don't forget to read the Forum rules and usage resources
    Posted 10 months ago #
  26. qb84

    Member
    Joined: May '12
    Posts: 26

    awesome! Now it works! Thanks for all the help :)

    Posted 10 months ago #

RSS feed for this topic

Reply

You must log in to post.