<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[JavaRanch: Latest posts for the topic "Caching the web page in client machine's browser"]]></title>
		<link>http://www.coderanch.com/forums/t/7/Servlets/Caching-web-page-client-machine</link>
		<description><![CDATA[Latest messages posted in the topic "Caching the web page in client machine's browser"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Hi Friends,<br /> I'm struck up with one issue in caching the web page in client machine's temporary internet files. I have designed a secured web application. I used <br />  <br /> &lt;%<br /> response.setHeader("Cache-Control","no-cache"); <br /> response.setHeader("Pragma","no-cache"); <br /> response.setDateHeader ("Expires", 0);<br /> %&gt;<br /> for not storing the web page in client machine. Now only some of the pages that doesn't needs the security needs to be cached in the client machines temporary internet files.<br /> For that i used the code as<br /> &lt;%<br /> response.setHeader("Cache-Control","public"); <br /> response.setHeader("Pragma","public"); <br /> response.setDateHeader ("Expires", 0);<br /> %&gt;<br /> Still i'm unable to store. Please help me solve this. Thanks in Advance. Quick help would be greatly appreciated.<br />  <br /> Thanks and regards,<br /> Prakash]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597925</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597925</link>
				<pubDate><![CDATA[Wed, Mar 12 2008 22:40:00 MDT]]></pubDate>
				<author><![CDATA[Rajendiran R. prakash]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[I tend to use something like these when encouraging resources to be cached:<br />  <br /> <pre>public static void setCacheExpireDate(HttpServletResponse response, int seconds)
{
if (response != null)
{
Calendar cal = new GregorianCalendar();
cal.roll(Calendar.SECOND, seconds);
response.setHeader(&quot;Cache-Control&quot;, &quot;PUBLIC, max-age=&quot; + seconds + &quot;, must-revalidate&quot;);
response.setHeader(&quot;Expires&quot;, htmlExpiresDate(cal.getTime()));
}
}
 
public static String htmlExpiresDate(Timestamp time)
{
        DateFormat httpDateFormat = new SimpleDateFormat(&quot;EEE, dd MMM yyyy HH:mm:ss z&quot;, Locale.US);
        httpDateFormat.setTimeZone(TimeZone.getTimeZone(&quot;GMT&quot;));
        return httpDateFormat.format(time);
}</pre>]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597926</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597926</link>
				<pubDate><![CDATA[Wed, Mar 12 2008 23:13:00 MDT]]></pubDate>
				<author><![CDATA[David O'Meara]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Hi friend,<br />   Thanks for the quick reply. But it doesn't work. Is there any other idea.<br />  <br /> <br /> Thanks & Regards<br />  Prakash...]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597927</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597927</link>
				<pubDate><![CDATA[Wed, Mar 12 2008 23:48:00 MDT]]></pubDate>
				<author><![CDATA[Rajendiran R. prakash]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[<blockquote class="uncited">
			<div>Originally posted by Rajendiran R. prakash:<br /> Hi friend,<br />   Thanks for the quick reply. But it doesn't work. Is there any other idea.<br />  <br />  <br /> Thanks & Regards<br />  Prakash...</div>
		</blockquote><br />  <br /> Maybe you could give us a little more to work with than "it doesn't work".<br /> How do you know it doesn't work?<br /> What did you do to test it?<br /> What were you expecting?<br /> What did you see?<br />  <br /> I, for one, wouldn't spend very much effort to help you after seeing how quickly you dismissed David's response.<br />  <br /> [ March 13, 2008: Message edited by: Ben Souther ]<br /> [ March 31, 2008: Message edited by: Ben Souther ]<br /> ]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597928</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597928</link>
				<pubDate><![CDATA[Thu, Mar 13 2008 06:21:00 MDT]]></pubDate>
				<author><![CDATA[Ben Souther]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Hi Ben,<br />    When i used the above code with some slight alterations, it works for my system(Stand alone). But when i tried with another system with this systems url it doesn't works. Help me please....<br /> Sorry if it hurts David.........<br /> Regards,<br />  Prakash.<br />  <br /> <br /> It Would be helpful if it is still clear....]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597929</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597929</link>
				<pubDate><![CDATA[Thu, Mar 13 2008 06:38:00 MDT]]></pubDate>
				<author><![CDATA[Rajendiran R. prakash]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Hi Ben and David,<br />  <br />            Sorry for that. It really hurts some one who help others. It works perfectly for me. I used the david's code with some alterations. Now i changed my code according to David's code. While i use that exactly the same way, it works perfectly. Also I had some browser issue. Once i reset it to default settings and tried it works fine.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597930</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597930</link>
				<pubDate><![CDATA[Mon, Mar 31 2008 05:40:00 MDT]]></pubDate>
				<author><![CDATA[Rajendiran R. prakash]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Thanks for the feedback.<br />  <br /> This is an important issue with respect to caching or not caching data on the client. Anything you do is just a request to the client and they are free to do what they want. That is, you can ask them to cache the code and they may decide not to, or you may ask them to cache the data and they may decide not to.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597931</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597931</link>
				<pubDate><![CDATA[Mon, Mar 31 2008 06:24:00 MDT]]></pubDate>
				<author><![CDATA[David O'Meara]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Thank you David,<br />             I feel sorry for that reply.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597932</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597932</link>
				<pubDate><![CDATA[Mon, Mar 31 2008 06:28:00 MDT]]></pubDate>
				<author><![CDATA[Rajendiran R. prakash]]></author>
			</item>
			<item>
				<title>Caching the web page in client machine's browser</title>
				<description><![CDATA[Nothing personal  <img src="http://www.coderanch.com/images/smilies/3b63d1616c5dfcf29f8a7a031aaa7cad.gif" /> <br />  <br /> I should also point out that the best you can do is look at the response headers too make sure the headers are being sent.]]></description>
				<guid isPermaLink="true">http://www.coderanch.com/forums/posts/preList/365495/1597933</guid>
				<link>http://www.coderanch.com/forums/posts/preList/365495/1597933</link>
				<pubDate><![CDATA[Mon, Mar 31 2008 07:02:00 MDT]]></pubDate>
				<author><![CDATA[David O'Meara]]></author>
			</item>
	</channel>
</rss>
