Search This Blog

Wednesday, June 2, 2010

Disable Browser Cache

Every time you use your web browser, your computer collects information about how you use it as well as generating local copies of files and documents you have viewed. This information is stored in folders on your hard drive and can be accessed by navigating to that folder or using a viewing utility within the web browser itself. Items that are stored include the cookies that the site you visit creates to store your preferences or

login information

, image files, html pages, PDF documents and even video files. In short, anything that you can access through the internet.

Advantages:-
~~~~~~~~~~~~~~
*. his automatic caching can be convenient, as it helps increase the speed of the page loading on your next visit

DisAdvantages:-
~~~~~~~~~~~~~~~~
*. it's also a major privacy risk.

Note: You may be visiting sites that you don't want others in your family to visit or maybe you want to ensure important username and password are kept private

Clear Login Credentials and Menu Constructing page based on Permissions etc..

For JSP,JSF:-
Apply this below code in all your view files..


             <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <meta http-equiv="Cache-control" content="no-cache"/>
            <meta http-equiv="Cache-control" content="no-store"/>          
            <meta http-equiv="Pragma" content="no-cache">
            <meta http-equiv="expires" content="0">

             <%
                        response.setHeader("Cache-Control", "no-cache");
                        response.setHeader("Pragma", "no-cache");
                        response.setDateHeader("Expires", 0);
                        response.setHeader("Cache-Control", "no-store");
            %>

No comments:

Hit Counter


View My Stats