Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Anyone have VCL snippets of that configure Varnish to work with AIS? Typically Varnish should strip cookies on files and remove cookies Drupal doesn't need so that more is returned from cache. Is there a way to configure Varnish to work with this module or does it require no caching on these requests? Thanks.
Comments
Comment #1
spotzero CreditAttribution: spotzero commentedThe cookie only maters if the path request path is "/files/styles/adaptive/", if the request unpath isn't that, its safe to remove all the cookies.
You could do something like this (warning, I just wrote this free hand, no guarantees that it compiles or works):
Let me know what you end up with.
Thanks,
Comment #2
vinmassaro CreditAttribution: vinmassaro commentedIt looks like your example is meant for vcl_fetch? I wasn't having any luck with it there.
Here is what worked for me in vcl_recv, by not caching ais paths. Thoughts?
Comment #3
spotzero CreditAttribution: spotzero commentedWhile there is some performance gain having Varnish cache the 302s, since the htaccess rules process the whole request and apache doesn't even run PHP, you're not missing out on much by not caching them.
Unless you've got a busy enough site that you have to worry about passing even those types of requests, it should be fine.
Comment #4
spotzero CreditAttribution: spotzero commentedComment #5
couloir007 CreditAttribution: couloir007 commentedI'm running varnish with ubuntu locally, and I can't this to work. Is this issue really resolved? It would be unfortunate that I can't use this because of varnish.
Comment #6
spotzero CreditAttribution: spotzero commentedDepends what you feel the solution should be.
The solution above was to simply tell varnish not to cache AIS's image style url at all. It works, but I'd liked to have had some fancy vcl that caches the adaptive style based on the ais cookie, though that's probably quite a complex solution.
Is the vcl code above not working for you?
Comment #7
couloir007 CreditAttribution: couloir007 commentedIt's not. I'm not a varnish expert, so I'll come back to this is I really need to. I'm developing on ubuntu, but ultimately it will reside on centOS, so I may wait until I get to the centOS part.
Thanks!
Comment #8
stone_d CreditAttribution: stone_d commentedHi there,
i got the same problem here. I wasn't sure why my site loads that long until i realized AIS isn't working anymore since having my site varnish-cached.
So: where do i have to put that code above in? Sorry - im not a varnish-expert ;)
Thanks in advance and regards,
F.