Forum Discussion
How to configure the cache to handle the Vary Header ?
Hi There,
The tricky thing is that the content of the answers (XML documents) provided to the clients depends from the Accept and Accept-Language HTTP Headers value that was passed to the server by the client.
One quick example should help to clarify:
but the same URL
http://192.168.1.1/docs/DOC_1 with the two headers= ‘Accept: notice=branch’ and 'Accept-Language: eng' returns an XML document of type Notice=branch in english
To help the cache module to serve the right content to the clients, the JBOSS needs to add the following Header in its HTTP Responses:
“Vary: Accept,Accept-Language”
Unfortunately, it seems that the Web Accelerator module doesn’t take in account this Vary Header and may serve the wrong content to the client (the branch notice instead of the object notice or vice-versa)…
Any ideas how to configure the WAM to handle correctly the Vary Header ?
- Make sure that the content being served is matching to the XML node in the WebAccelerator policy. XML pages should be matching to the XML node in the library policy. The default settings on this node is for WebAccelerator to not cache the content. If the default settings have been changed the variation rules need to be used to ensure that content is cached appropriately. In your example you would need to add a variation rule for the Accept header. The default is that all headers serve the same content and in this case the Accept:notice header needs to be defined to serve different content.
- Jean-Christoph6NimbostratusHi Dwan,
- Glad that worked. Yes the Vary header is very particular. Many browsers only recognize the vary= accept-encoding header. Any other vary header makes content uncacheable by the browser.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com