OutputCache Duration across time zones?

Discussion in 'ASP .Net' started by CJ, Jan 3, 2006.

  1. CJ

    CJ Guest

    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!
    CJ, Jan 3, 2006
    #1
    1. Advertising

  2. CJ

    Derek Harmon Guest

    "CJ" <> wrote in message news:...
    > 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
    Derek Harmon, Jan 3, 2006
    #2
    1. Advertising

  3. CJ

    CJ Guest

    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!
    CJ, Jan 6, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. z. f.
    Replies:
    0
    Views:
    416
    z. f.
    Feb 10, 2005
  2. z. f.
    Replies:
    5
    Views:
    4,602
    Juan T. Llibre
    Feb 10, 2005
  3. Eric Wertman

    time module question - time zones

    Eric Wertman, May 21, 2008, in forum: Python
    Replies:
    0
    Views:
    489
    Eric Wertman
    May 21, 2008
  4. Eric Wertman

    Re: time module question - time zones

    Eric Wertman, May 21, 2008, in forum: Python
    Replies:
    0
    Views:
    490
    Eric Wertman
    May 21, 2008
  5. Harlan Messinger

    Dates, time zones,daylight saving time

    Harlan Messinger, Apr 15, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    997
    Eric Isaacs
    Apr 16, 2010
Loading...

Share This Page