开发者

clear page cache when language changes

开发者 https://www.devze.com 2023-03-06 14:57 出处:网络
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 invalidate

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消