• Resolved jeffatrackaid

    (@jeffatrackaid)


    Are there guidelines for using Varnish with NextGen Gallery?

    Issue
    We use the slideshow function on our home page. When we add a new image to the slide show, the image is blank but the overlaid text appears without issue.

    It appears the image is not being loaded by the slider, but the reference to the image is in the HTML code.

    We are using the js slider. Are there any cookies or other files required to get these images to load properly?

    If we fully flush the cache, the slider works fine.

    I’ve not tried to force flush just the home page but I don’t think that is the issue since the HTML code updates to the correct image the image is just not show.

    I will try to get a video of the issue.

    We have multiple varnish caches and we prefer not to manually purge but let the timeouts handle purging automatically.

    Any insights appreciated.

    https://wordpress.org/plugins/nextgen-gallery/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – We use “Varnish” on http://nextgen-gallery.com/ but to be honest (aside from it causing intermittent problems with the site in general) I have no idea if there are any specific settings it requires to work well with NextGEN Gallery … as far as I know it is more or less a “default” setup.

    I can ping our developer that manages the server installations/environments on this but they are extremely busy at the moment and may not get back to this very soon.

    – Cais.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    Thanks. We may need to buy a pro license if that would help speed up support on this issue.

    We actually have 2 front-end Varnish caches that are load balanced behind 2 load balancers. There’s no affinity so a user can hit any of the nodes (eventually to be 5 app nodes).

    One issue with this setup is the cache’s can diverge but that’s really an issue since all images should have an unique URL.

    My only though is that NextGen thinks it already has an image but it actually does not. So when it comes time to display it the browser does not have a copy nor fetches a copy.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    Do you happen to know if the NextGen plugin require URL arguments to work properly? That could be an issue as our cache treats

    www.domain.com/index.php?arg=$ARG

    the same as

    www.domain.com/index.php

    The request is passed to the backend but from the eyes of the cache this is the same object.

    Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – To be honest, Varnish configuration is out of my knowledge set so I really cannot say if any of your ideas would work or not.

    Generally server configuration, such as Varnish setup, would be outside our scope of support (even if you were a NextGEN Pro subscriber) but I have asked our developer (noted above) to look at this specific topic all the same. The additional information and questions you provided may help to quicken the response.

    – Cais.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    Thanks for your attention for this.

    We having been working on a Varnish/Nginx/PHP-FPM stack where we no longer have to use things like W3TC, SuperCache or similar tools. We find those tools buggy and difficult to manage over a large number of sites.

    Instead, we are working on adding smarter logic to varnish/nginx to promote caching at those levels.

    We have some customers doing 50 million+ page views/mo, so caching is key.

    Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – I do not believe we are using the same setup (“Varnish/Nginx/PHP-FPM”) which may also be adding components to the issue(s) you are seeing.

    – Cais.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    I think we have found the issue. This is a working theory at this point as has more to do with WP than the plugin.

    We get this result on the home page when the problem appears:

    http://screencast.com/t/pNywpnpe5

    The post title is displayed with no image.

    As it turns out, the HTML code does not have a link to the image.

    Workflow & Last-Modified/Dates

    We are still testing, but the issue appears in part due to author workflow issues and last-modified dates.

    On this site, the authors use a special category (slideshow) to add an image to the home page slide show. Logic in index.php takes care of this.

    An issue arises when the authors save a post into the slideshow category before selecting a slideshow image.

    Even if this is short lived, the home page temporarily has a page without an image. The system then caches this.

    We had implemented a Last-Modified header to fix an issue with some readers. I think this header may be the issue.

    When you toggle a category or slide show image on a post, it does not update the Last-modified date on the home page.

    The result is that the incorrectly cached page can persist until some other function updates the home pages last-modified date.

    We are going to remove the last-modified header and see if that helps.

    The main issue is that WP has many options that can influence the home pages code but it does not properly update the last modified date. This is more of a WP issue than a plugin issue.

    Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – Thanks for the follow-up. Please let us know if there is anything we can help with.

    Thanks!

    – Cais.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    We’ve ruled out cache/infrastructure setup as the problem. The problem is in the coding for the site itself.

    The cache’s are simply manifesting the problem because they are grabbing copies of the HTML code that is very ephemeral otherwise.

    So you can mark this as resolved as it has nothing to do with the slider plugin itself but other code issues.

    Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – Happy and sad news. I hope you are able to sort things out quickly.

    Best of luck!

    – Cais.

    Thread Starter jeffatrackaid

    (@jeffatrackaid)

    Just wanted to update this case as I don’t see a lot of data about scaling NextGen or Varnish.

    The problem turns out to be APC. With or without the APC caching plugin, some code somewhere caches title data into APC. Since we are using a cluster of servers, this fails.

    In addition to the image issues noted previously, authors saw that it took a long time for title changes to appear on the home page.

    The developers now are going to dig through the code to find out why titles are getting cached into APC on the home page. I am not sure if it has to do with Nextgen or not. Oddly, this does not imapact single blog post pages. (They just acquired the site so fixing up some issues).

    I have since dropped in memcached object cache and configured it to use the frontend app servers as memcache servers. This resolved the issue as did completely removing APC cache.

    So the lesson here is never assume anything when dealing with code from others … πŸ™‚

    Plugin Contributor photocrati

    (@photocrati)

    @jeffatrackaid – Thanks for the continued updates … if there is anything your developers come across that can be addressed in NextGEN Gallery please feel free to send us a Bug Report (http://www.nextgen-gallery.com/report-bug/ … please reference this topic) as needed.

    Thanks, again!

    – Cais.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘NextGen Gallery & Varnish’ is closed to new replies.