« Previous Next »

Thread: ARR v2 RC - NETSH HTTP shows extra cache entries for WebResource.axd

Last post 10-31-2009 2:08 AM by anilr. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 10-30-2009, 10:41 AM

    ARR v2 RC - NETSH HTTP shows extra cache entries for WebResource.axd

    In examining the HTTP kernel cache on my ARR machines, I have been spotting extra entries for URI's that I would not expect to be cached.  Further, the Cache Entry TTL for these cache entries is very large (> 31500000).

    Let me provide some background.  Due to issues w/ 3rd party controls when we first tested ARR we engineered our application to segregate cacheable content from data.  So we have one farm that purely caches content (with a 99% cache hit rate) and a second that serves dynamic data without caching.

    I am seeing HTTP cache entries for resources on the non-cached server farm such as "WebResource.axd"  with these unusual long TTL's.  I am concened that a users might inadvertently received cached data from a different user's session.  However we are not seeing that happen in any of testing.  Can you explain what is going on with these cache entries?

    At the Server Farm level, my cache setting on the non-cached server farm are as follows:

     Memory cache duration = 0
     Enable Disk Cache = Off
     Enable Request Consolidation = Off
     Query String Support  = No Caching

    Thanks for any replies

    Jim

     

     

  • 10-30-2009, 1:08 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    Setting memory cache duration to 0 only disables caching of static-files that ARR decides to auto-cache even though they do not contain any cache-control headers in the response.  It does not apply to responses which have a Cache-Control/Expires header in the response - what are the headers on the webresource.axd response that is cached? - you can request from wfetch to get that information. (the duration seems like exactly one year).

    If you want to also disable caching even for responses containing Cache-Control/Expires header, you can add the following to the rule routing the request to that particular web-farm.

    <serverVariables>
      <set name="ARR_CACHE_CONTROL_OVERRIDE" value="1,private" />
    </serverVariables>

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 10-30-2009, 3:30 PM In reply to

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    Anil,

    Thanks for the reply.  The reason I specifically asked about Webresource.axd is that is not a user-created content, it is a special handler for retreiving ASP.Net assembly resources (reference http://support.microsoft.com/kb/910442).  

    For that reason, I would like to understand why the ASP.net resoruce hanlder would be cached on ARR?  Is it by design that this handler conent can be cached?  If truly is a cache-control/expires header issue, where would somone go to change that?

    I will run down the Cache-Control/Expires header with WFetch 1.4 (http://www.iis.net/downloads/default.aspx?tabid=34&i=1307&g=6) and post back with results.

    Thanks again,

    Jim

  • 10-30-2009, 3:44 PM In reply to

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    Anil,

    I found an instance of Webresource.axd in the HTTP cache then loaded those settings into WFetch and retreived the following cache control headers: 

    HTTP/1.1 200 OK\r\n
    Cache-Control: public\r\n
    Content-Length: 38446\r\n
    Content-Type: text/javascript\r\n
    Expires: Sat, 30 Oct 2010 19:22:33 GMT\r\n
    Last-Modified: Thu, 29 Oct 2009 11:11:31 GMT\r\n
    Server: Microsoft-IIS/7.0\r\n
    X-AspNet-Version: 2.0.50727\r\n
    X-Powered-By: ASP.NET\r\n
    Date: Fri, 30 Oct 2009 19:36:25 GMT\r\n

    BTW the "Expires: Sat, 30 Oct 2010 19:22:33 GMT" does look to be a 1 year expiration.

    Jim

  • 10-30-2009, 3:59 PM In reply to

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    Anil,

    Just for your reference the each ASP.Net page has the following caching directive.

        ' Limit & disable Client Side Cache
        Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache)

    Jim

  • 10-30-2009, 4:17 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    The Cache-Control: public is what makes the content cached forever.  I don't know why asp.net is sending webresource.axd response with Cache-Contro: public (you will have to ask an asp.net expert), but you can use the above server-variable in your rewrite rule to override the cache-control directive being sent by the server.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 10-30-2009, 5:19 PM In reply to

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    Anil,

    Thanks, we will follow-up on the ASP.Net communities. Preliminary results seem to indicate you can not programmatically control cache headers for WebResource.axd.

    My riddle to the ARR team is... I only see a HTTP cache entries for WebResource.axd on the ARR servers not on the load balanced content nodes.  Any ideas why that might be different?

    Jim

  • 10-31-2009, 2:08 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: ARR v2 RC - NETSH HTTP shows extra cache entries

    I know that asp.net in some case will only send cache-control headers for client/proxy caching, but will not ask the content on the server, that is probably why the content in not cached on the backend server.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (8 items)
Microsoft Communities