In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces "let HTML and JSP pages do not cache from the Web server to retrieve the page method steps," in daily operation, I believe many people in let HTML and JSP pages do not cache from the Web server to retrieve the page method steps on the question there are doubts, Xiaobian consulted all kinds of information, sorting out simple and easy to use the operation method, hope to answer everyone "let HTML and JSP pages do not cache from the Web server to retrieve the page method steps" doubts help! Next, please follow the small series to learn together!
If the user clicks the Back button on the browser after exiting, the Web application will not protect the protected page properly--the protected JSP page will reappear in the browser after the Session is destroyed (the user exits).
However, if the user clicks on any link on the return page, the Web application will jump to the landing page and prompt Session has ended.Please log in.
The root of the problem is that most browsers have a back button.
When the Back button is clicked, by default the browser loads the page from the browser cache instead of retrieving it from the Web server.
Java-based Web applications do not limit this functionality, and the same problem exists in PHP, ASP, and. NET-based Web applications.
Fortunately, the HTTP headers "Expires" and "Cache-Control" provide a mechanism for application servers to control caching on browsers and proxy servers.
The HTTP header Expires tells the proxy server when its cached pages will expire.
The HTTP 1.1 specification defines a new header, Cache-Control, that tells browsers not to cache any pages.
When the Back button is clicked, the browser revisits the page that the server has retrieved.
Here is the basic way to use Cache-Control:
1)no-cache: Force cache to fetch new pages from server
2)no-store: cache does not store any pages in any environment
To be safe, it's best to add some settings to both html pages and jsp
For HTML pages, add:
The code is as follows:
For JSP pages, add:
The code is as follows:
That's it.
At this point, on the "HTML and JSP pages do not cache the method steps to retrieve pages from the Web server" learning is over, I hope to solve everyone's doubts. Theory and practice can better match to help you learn, go and try it! If you want to continue learning more relevant knowledge, please continue to pay attention to the website, Xiaobian will continue to strive to bring more practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.