Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Caching / June 2004

Tip: Looking for answers? Try searching our database.

Clear Browser Cache

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pradeep D - 23 Jun 2004 11:39 GMT
Hi,

Is there a way to clear the browser cache programmatically, i'm my page, i have written nothing to cache anything. i want the page to load a fresh everytime. kindly give in your comments.

Pradeep
M. Zeeshan Mustafa - 23 Jun 2004 13:06 GMT
try putting this code on page you'd like browser not to cache:

Response.CacheControl = "no-cache"
Response.ExpiresAbsolute = Now() - 1
Response.Buffer = True
Response.Expires = 0

whenever user visits the page which has above code, page contents
are not cached into his browser.

Signature

Hope this helps,
Zeeshan Mustafa, MCSD

> Hi,
>
> Is there a way to clear the browser cache programmatically, i'm my page, i have written nothing to cache anything. i want the page to load a fresh
everytime. kindly give in your comments.

> Pradeep
Scott M. - 23 Jun 2004 14:39 GMT
> Response.CacheControl = "no-cache"
> Response.ExpiresAbsolute = Now() - 1
> Response.Expires = 0

My understanding is that these settings are not for browser caches, they
indicate weather the page should be cached by proxy servers that support
page caching.

> Response.Buffer = True

This is the default setting anyway and has nothing to do with caching.  This
indicates that the response object should buffer all of its output to the
client and only release it to the client when the processing has completed.
M. Zeeshan Mustafa - 23 Jun 2004 15:17 GMT
response.expires is the lenght of time in minutes before
cached response on the browser expires.

response.expiresabsolute sets the date/time when a response page
stored in browsers cache will expire.

response.cachecontrol = 'no-cache' tells proxy server to not cache
this response into its cache... it adds Pragma: no-cache in http response
header. see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
section 14.32 Pragma

response.buffer = true .. this is because if its set to false, web server
may start responding chunk by chunk, and proxy server will have to cache
those chunks because its not receiving all data at once.

response.expires and response.expiresabsolute are for browser, however
you can use client side HTML tags to control it too.
see http://www.i18nguy.com/markup/metatags.html

Signature

Hope this helps,
Zeeshan Mustafa, MCSD

> > Response.CacheControl = "no-cache"
> > Response.ExpiresAbsolute = Now() - 1
[quoted text clipped - 9 lines]
> indicates that the response object should buffer all of its output to the
> client and only release it to the client when the processing has completed.
Scott M. - 23 Jun 2004 16:48 GMT
> response.buffer = true .. this is because if its set to false, web server
> may start responding chunk by chunk, and proxy server will have to cache
> those chunks because its not receiving all data at once.

If the proxy receives portions of the response (buffer = false) will it not
just relay those fragments to the client?
M. Zeeshan Mustafa - 24 Jun 2004 05:52 GMT
Scott it will relay as soon as it starts receiving data, but if the
response.buffer is true then it will receive the whole response
at once and forward it to client.
Scott M. - 24 Jun 2004 16:51 GMT
Yes, I know.  So what does the buffer setting have to do with proxy caching
then?

> Scott it will relay as soon as it starts receiving data, but if the
> response.buffer is true then it will receive the whole response
> at once and forward it to client.
M. Zeeshan Mustafa - 24 Jun 2004 05:53 GMT
Scott it will relay as soon as it starts receiving data, but if the
response.buffer is true then it will receive the whole response
at once and forward it to client.

Signature

Hope this helps,
Zeeshan Mustafa, MCSD


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.