为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

J2EE application caching issue in Firefox 64 after setting "Cache-Control", "no-store, no-cache, must-revalidate" | "Pragma", "no-cache" |

more options

I have J2EE web application site which sends the response header as cache:control set to "no-store, no-cache". After logout when the user is pressing the back button of the browser, user is thrown with the cache-expired page, and it’s working as expected. But if the user clicks on the view-page-source on the cache expired page, user is shown with the source code of the previous logged in page with all confidential data pertaining to logged out user. Please let us know do we need any specific response header for Mozilla Firefox to disable the caching of the source code? Your help is much appreciated.

       p_response.setDateHeader("Expires", -1);
       p_response.setHeader("Expires", "0");
       p_response.setDateHeader("Last-Modified", System.currentTimeMillis());
       p_response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate");
       p_response.addHeader("Cache-Control", "post-check=0, pre-check=0, false");
       p_response.addHeader("Pragma", "no-cache");

Thanks

I have J2EE web application site which sends the response header as cache:control set to "no-store, no-cache". After logout when the user is pressing the back button of the browser, user is thrown with the cache-expired page, and it’s working as expected. But if the user clicks on the view-page-source on the cache expired page, user is shown with the source code of the previous logged in page with all confidential data pertaining to logged out user. Please let us know do we need any specific response header for Mozilla Firefox to disable the caching of the source code? Your help is much appreciated. p_response.setDateHeader("Expires", -1); p_response.setHeader("Expires", "0"); p_response.setDateHeader("Last-Modified", System.currentTimeMillis()); p_response.addHeader("Cache-Control", "no-store, no-cache, must-revalidate"); p_response.addHeader("Cache-Control", "post-check=0, pre-check=0, false"); p_response.addHeader("Pragma", "no-cache"); Thanks

所有回复 (2)

more options

Hi,

the use of the cache is documented in the DND documentation, which I believe will be answered by the following links


https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control

https://developer.mozilla.org/en-US/docs/Web/API/Request/cache


thank's

more options

Thanks for the reply, the options in the specified url works fine only for chrome and IE browser and not for Firefox 64.02 Here is the snippet of the code:

p_response.setDateHeader("Expires", -1);

p_response.setHeader("Expires", "0");

       p_response.setDateHeader("Last-Modified", System.currentTimeMillis());
       p_response.addHeader("Cache-Control", "private, no-store, no-cache, must-revalidate");
       p_response.addHeader("Cache-Control", "post-check=0, pre-check=0, false");
       p_response.addHeader("Pragma", "no-cache, no-store");
       p_response.addHeader("Clear-Site-Data", "cache, cookies, storage, executionContexts");
       p_response.addHeader("cache", "force-cache");

Thanks