Jump to content

Caching same URL separately - using Symfony2


johnsmith153

Recommended Posts

I'm using Symfony2's reverse proxy cache (all default settings etc.), so I want to integrate it with that, but even non-Symfony users will be able to help.

 

My example below changes certain headers (so not PHP related), but it may need to be changes in PHP or Symfony2 code that gets the actual result. Any help at all may help to solve what has become a very difficult problem.

 

The site in question allows for a 'basic' site view by scaling down images and removing JavaScript. As the content is the same I have used the same URL, but of course caching is an issue.
 
I need to be able to cache them separately (or just ensure the cache is cleared).
 
I have tried changing the Vary header which normally I have set to:
 
    Vary: Accept-Encoding
 
..and have set it to either:
 
    Vary: Accept-Encoding, basic
 
..or:
 
    Vary: Accept-Encoding, normal
 
That actually works brilliant in Chrome on Mac, but Safari ignores the extra part of the Vary header. I stopped checking other browsers at this point.
 
Any advice, either caching related or Symfony2 related?
Edited by johnsmith153
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.