set cache-control tp private to public

S

sviau

should cache-control be set to public or private on dynamic site. our
content doesnt change for 24hrs, but because results from search pages vary
so much, we cant cache the pages themselves.

what other header info should i explicetly setting in the asp.net page to
make sure that the site is cached as much as possible?

Show Headers from http://www.mls.ca

Request headers sent:

HEAD / HTTP/1.0
Host: www.mls.ca
Referer: http://www.web-caching.com/
User-Agent: ReadHeaders/0.01 (www.web-caching.com)
Accept: */*


Received redirect headers:

HTTP/1.0 302 Moved Temporarily
Server: Microsoft-IIS/5.0
Date: Thu, 19 Feb 2004 21:33:52 GMT
X-Powered-By: ASP.NET
X-AspNet-Version: 1.1.4322
Location: /map.aspx
Cache-Control: private
Content-Type: text/html; charset=utf-8
Content-Length: 126
X-Cache: MISS from www.mls.ca
Connection: close
 
S

Steven Cheng[MSFT]

Hi sviau,


Thanks for posting in the community!
From your description, you have an ASP.NET site which will generate dynamic
pages to users such as a search system. And since the Search result are
contant, so you'd like to cache them,yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, for your situation that those page are dynamically
generated via the user's input or some certain params,yes? There are two
means you can take:
1. Using the serverside outputcache provided by the ASP.NET
The ASP.NET's output cache can cache a certain page's certain version on
the serveside's memory, the version can be determined via different ways,
for example, querystring, time period, or event custom controling it. Thus,
when the ASP.NET detect that a certain version of the same request is
cached before, it'll directly returned the reponse retrieved from server's
cache rather than generated it again. I'm sure this is very wonderful for
some search system which need to cache pages for different search
querystrings, do you think so? And here are some tech reference on ASP.NET
outputcache, you may have a view to see whether it helps you.

#Caching ASP.NET Pages
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconaspoutputcache.asp
?frame=true

#Caching Multiple Versions of a Page
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcachingmultiplever
sionsofpageorcontroloutput.asp?frame=true

2. Using the user's client browser's cache ability.
In addition to ASP.NET's page cache ability, generally the client browser
will also cache a certain page on the clientside, we can set the http
header of the response. And here are also some tech articles on this:

#How to Modify the Cache-Control HTTP Header When You Use IIS
http://support.microsoft.com/default.aspx?scid=kb;en-us;247404

#Client-Side Page Cache
http://developer.apple.com/documentation/WebObjects/Web_Applications/Backtra
ckingAndCache/chapter_6_section_2.html

#HTTP Caching in Mozilla
http://www.mozilla.org/projects/netlib/http/http-caching-faq.html

Please check out the above suggestions to see whether they help.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
S

Stephane Viau

yes im familiar with asp.net cahcing, and client cahcing; but the
question is:
is Cache-Control: private setting correct in the header? or should it be
set to public? what does this affect?

thanks
stephane
 
S

Steven Cheng[MSFT]

Hi Stephane,

Thanks for your followup. As for the Cache-Control header you, it can be
set in ASP or ASP.NET via
Response.CacheControl = (Public | Private | no-cache) .
The difference between private and public is that if set as private, the
cache will only speicfy to only the client , if "public" not only the
client, the other proxys are also able to cache this response. So as for
your situation, the private (by default) is enought. And here is the
detailed reference in MSDN:

#Response.CacheControl
http://msdn.microsoft.com/library/en-us/iissdk/iis/ref_vbom_resopcc.asp?fram
e=true

Also, here is the HTTP/1.1 Cache-Control directive reference:
#HTTP/1.1 Cache Control
http://www.eurecom.fr/~ross/CacheTutorial/tsld067.htm



Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top