Disable page caching without disabling caching of jpegs andstylesheets etc

J

JimLad

Hi,

We have a data based web app that basically must not cache any of the
pages as they contain real time data.

I am currently using the following line in the page template on the
PreInit event:
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Will this prevent things like Jpegs and CSS stylesheets from being
cached as well?

If so is there another way of doing this?

Cheers,

James
 
A

Andrew Morton

JimLad said:
We have a data based web app that basically must not cache any of the
pages as they contain real time data.

I am currently using the following line in the page template on the
PreInit event:
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Will this prevent things like Jpegs and CSS stylesheets from being
cached as well?

If so is there another way of doing this?

In IIS, you can set content to expire immediately, e.g. for IIS 6.0:
http://www.microsoft.com/technet/pr...fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true

Andrew
 
B

bruce barker

no, it only disables it for the current response content. as every image
is its own request/respone, the cache header set when the image is fetched.

-- bruce (sqlwork.com)
 
J

JimLad

no, it only disables it for the current response content. as every image
is its own request/respone, the cache header set when the image is fetched.

-- bruce (sqlwork.com)








- Show quoted text -

Thanks guys. I realised I didn't explain myself very well. I want
jpegs and stylesheets to be cached but not the page content itself so
sounds like I'm doing it the right way.

Many thanks,

James
 

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,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top