Disable page caching without disabling caching of jpegs andstylesheets etc

Discussion in 'ASP .Net' started by JimLad, Jan 20, 2010.

  1. JimLad

    JimLad Guest

    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
    JimLad, Jan 20, 2010
    #1
    1. Advertising

  2. Re: Disable page caching without disabling caching of jpegs and stylesheets etc

    JimLad wrote:
    > 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
    Andrew Morton, Jan 20, 2010
    #2
    1. Advertising

  3. JimLad

    bruce barker Guest

    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)

    JimLad wrote:
    > 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
    bruce barker, Jan 21, 2010
    #3
  4. JimLad

    JimLad Guest

    On 21 Jan, 01:44, bruce barker <> wrote:
    > 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)
    >
    >
    >
    > JimLad wrote:
    > > 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- Hide quoted text -

    >
    > - 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
    JimLad, Jan 21, 2010
    #4
    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. Brian Henry

    created jpegs

    Brian Henry, Jul 21, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    400
    Brian Henry
    Jul 21, 2003
  2. Aaron Davies
    Replies:
    4
    Views:
    643
    dar7yl
    Jun 30, 2004
  3. pradeep_TP

    Disabling page caching not working

    pradeep_TP, Apr 11, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    424
    pradeep_TP
    Apr 12, 2008
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    390
    Fredrik Lundh
    Aug 13, 2008
  5. grimmus
    Replies:
    3
    Views:
    388
    Paul McGuire
    Sep 16, 2009
Loading...

Share This Page