Search code examples
internet-explorerhttp-headersbrowser-cachefiddlerhttp-status-code-304

Why am I getting 304 when - "every time I visit the page" is on?


We have an (old) intranet site which has this setting

Every time I visit the page : true

enter image description here

But still I can see in developer tools many 304 replies :

enter image description here

Question :

  • Why is that ? How can I force to see all responses as 200 ?

Related info :

IIS 7.5

It happens in IE9-10 ( the site run only on IE) ( the browser mode is changed to ie9 because it is an old web site (intranet) which wasnt adjusted to the new browsers.

Using fiddler - it also shows 304.

enter image description here

enter image description here

enter image description here

Request header example :

enter image description here


Solution

  • Checks for newer versions of stored pages every time I visit the webpage

    Simply means that IE will ('check', hence) include the caching-related headers (If-Modified-Since, ETag etc) in the request. The server will then return 200 only if it feels that there's a cache 'miss'.

    Also, note that the settings in question ONLY apply when the server fails to specify the cache-freshness lifetime using a Cache-Control or Expires response header. See the Conditional Requests section of this article to learn more.

    If you want to configure your server to disable client-side caching for the entire directory, try this:

    <configuration>
      <location path="your_assets_dir">
        <system.webServer>
          <staticContent>
            <clientCache cacheControlMode="DisableCache" />
          </staticContent>
        </system.webServer>
      </location>
    </configuration>