Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9119995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:31:46+00:00 2026-06-17T05:31:46+00:00

According to Ultra-Fast ASP.NET: Chapter 3 – Caching : Files that the browser retrieves

  • 0

According to Ultra-Fast ASP.NET: Chapter 3 – Caching:

Files that the browser retrieves from the server should be stored in
the browser’s cache as long as possible to help minimize server
round-trips.

  • But how does IIS know what a static content actually is and is not?

    Is it just images, CSS, JS and not ASPX, ashx…?

    Where can I see in IIS what is already considered to be static and what is not ?

  • What about the scenario where a page has been declared with <%@ OutputCache header (without location)? Are the images, CSS and JS source files inside of it also being output cached with the same properties?

  • As a best practice, I should set one year into the future as the maximum expiration time. I should use that as the default for all static content on the site

So I did this :

Set Common HTTP Response Headers

But later, after pressing OK, I can’t find any summary menu which shows me: to whom I already put a response header (in this case: the css folder).

Currently, in order to see that css folder has been applied with response headers – I have to go to the css folder again --> Http Response Header-->Set Common Headers --> and then I see it. It isn’t written in the web.config.

But if I do it for a file (Login.aspx for example): I do see it in web.config:

<configuration>
    <location path="Login.aspx">
        <system.webServer>
            <staticContent>
                <clientCache cacheControlMode="UseExpires" cacheControlMaxAge="1.00:00:00" httpExpires="Fri, 15 Feb 2013 00:00:00 GMT" />
            </staticContent>
        </system.webServer>
    </location>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T05:31:47+00:00Added an answer on June 17, 2026 at 5:31 am

    I understand your situation. Sometime its confusing how IIS handles a file. Its also different for IIS 6 vs IIS 7 and different for Classic App Pools and Integrated mode app pools. My experience is mostly with Integrated App Pools on IIS 7.5, so thats the environment I can comment on most accurately.

    First Question

    But how does IIS knows what is actually a static content and what is
    not?

    Is it just images , css , js and not ASPX , ashx…?

    Where can I see in the IIS what is already considered to be static and
    what not ?

    You can inspect the list of file handlers in IIS by navigating to your website and then click ‘Handler Mappings’. By default these are inherited from the .Net base web.config which is in a different location depending on your .Net framework version.

    • C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\web.config
    • C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config

    If a file being requested isn’t already explicitly mapped to another handler it falls to a catch all handler (*) as the last option (System.Web.DefaultHttpHandler) which determines if it is a static file or a directory browsing request. So Static files are simply files not bound to another handler already. For example you’ll see that *.aspx is already mapped to System.Web.UI.PageHandlerFactory prior to this default handler. So its going to be processed by that handler and not be considered a static file. If you removed that mapping you could technically serve *.aspx as a static file if you really wanted to (just for proof of how it works).

    But you can also explicitly list a file type as a static file by adding an entry in your web.config’s httpHandlers section mapping the file extensions to System.Web.StaticFileHandler in IIS. For example:

    <configuration>
      <system.webServer>
        <handlers>
          <add name="StaticHandler" verb="*" path="*.zip" type="System.Web.StaticFileHandler" preCondition="integratedMode" />
        </handlers>
      </system.webServer>
    </configuration>
    

    This example is using the <system.webServer> config section, so its for an App Pool running in Integrated Mode.

    Second Question

    What about the scenario where a page has been declared with <%@
    OutputCache header(without location) . does the images,css,js src
    files inside of it , are also being output cached with the same
    properties?

    No. Because the page is being server as a separate request (maybe even by a separate handler) it can have totally different cache headers/hints. The host page and the resources it may use are not related from a caching perspective.

    In fact you may even want to have a shorter cache period for *.html and a longer cache period for *.jpg or *.png? Something to consider.

    Third Question

    As a best prcatice , I should set one year into the future as the
    maximum expiration time.I should use that as the default for all
    static content on the site

    Hmm… I might not go as far as one year. How about one month? I would set a global policy like this:

    <configuration>
      <system.webServer>
        <staticContent>
          <!-- Set expire headers to 30 days for static content-->
          <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="30.00:00:00" />
        </staticContent>
      </system.webServer>
    </configuration>
    

    This is the same as the sample you showed above, but is not inside a <location> element, instead it is right in the root <configuration> element so it is the default policy. Again this is for an App Pool running in Integrated Mode. Sometimes you also need to turn on:

    <configuration>
        <system.webServer>
            <modules runAllManagedModulesForAllRequests="true">
                <!-- stuff -->
            </modules>
        </system.webServer>
    <system.webServer>
    

    This just makes sure that static files are processed through the managed static file handler which respects the above configuration elements.

    Edit to Address Comments

    The documentation for the configuration dialog you posted above is located here: Configure the HTTP Expires Response Header (IIS 7)

    Apparently these settings are saved in C:\Windows\System32\inetsrv\config\applicationHost.config

    I do not have IIS7 and personally develop on IIS 7.5 now. So please post a comment if you can verify this location is accurate!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this article from Herb Sutter, one should always pick Class Specializing over
According to the msdn.microsoft.com site, .NET 3.5 Routing should work under IIS6 and II7
According to PHP.net manual, pg_pconnect will create a persistent connection, or will return the
According MSDN, FxCop is an application that analyzes managed code assemblies (code that targets
According to Hibernate documentation : After observing that arrays cannot be lazy , you
According to docs at http://code.google.com/p/minify/wiki/UriRewriting $min_serveOptions['rewriteCssUris'] = false; I should be able to add
According to this MSDN article , you should not catch general exceptions. I'm sure
According to the Ruby on Rails Guide: Caching , caching is disabled by default
According to my flow I am pushing the new changes to my server new_release
According to an answer in this thread , semicolons are bad and should be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.