I have my .net web site set up to cache rendered pages in the browser.
My site is multi lingual so when the user selects a different language on the site, I want to the browser cache to be invalidated.
Is this something I set up when the request header or something I can trigger when the user changes their language?
I have 开发者_运维技巧set up the caching of the site in my web.config.
I don't actually know how you did the switching... Let's assume that you know when certain user changes his/her language. If you do, you can set Last-Modified header in your HTTP Response for current date and it should invalidate the response.
You may want to play with Content-Language header as well. I am not aware of browser support (need to test it actually). Theoretically, how I understand it, it should affect browser caching policy; new language content should be loaded and cached for the future.
精彩评论