OutputCache Duration across time zones?

C

CJ

If I set the outputcache like this..

<%@ OutputCache Duration="900" VaryByParam="none" %>

on a server on the east coast. Will someone who hits the site on the
west coast get three hours added to the cache expiration?

it mentions at msdn that Response.Cache.SetExpires should follow UTC
and any HTTP1.1 docs that you read on w3c will say that UTC is the only
accepted format.

does asp.net set the response header according to UTC?

thanks in advance!
 
D

Derek Harmon

CJ said:
If I set the outputcache like this..

<%@ OutputCache Duration="900" VaryByParam="none" %>

on a server on the east coast. Will someone who hits the site on the
west coast get three hours added to the cache expiration?

Someone who hits the site from the Pacific coast will have the same
cache duration as someone hitting the site from Asia, and that is 15
minutes.

Yes, ASP.NET / IIS will set the HTTP header for cache expiration in
universal time (automatically adjusted from the host machine's system
time and local time zone; so if these are improperly set then the cache
duration may not be as long as you think it is). An objective time is
an example of why the HTTP protocol exists (to standardize behavior).
One can only imagine the tremendous mess the Internet would be in
were all times local.


Derek Harmon
 
C

CJ

Many thanks Derek!

I suppose that you could fool the browser cache if you had the client
time zone set incorrectly. I was having a difficulty with
understanding why any example of setting the outputcache always looks
like this..

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));

When technically I would think that you would need to use something
like..

Response.Cache.SetExpires(DateTime.Now.ToUniversalTime().AddSeconds(60));

Anyhow.. Thanks again!
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top