cache-control

Does the ASP.NET OutputCache directive actually cache or just set some Response properties?

Hi folks, When someone uses the OutputCache directive in an ASP.NET WebForms/MVC application, does it actually do any caching server-side, like using the Cache or does it only setup some properties in the Response object like the Cache-Control property? Cheers :) ...

Why does using ASP.NET OutputCache keep returning a 200 OK, not a 304 Not Modified?

Hi folks, i have a simple aspx page. Here's the top of it:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Foo.aspx.cs" Inherits="Foo" %> <%@ OutputCache Duration="3600" VaryByParam="none" Location="Any" %> Now, every time I hit the page in FireFox (either hit F5 or hit enter in the url bar) I keep gettin...

Is this web page getting cached?

Hi folks, when I hit some web resource / url / web page a number of times, i get back HTTP 200 OK with the Cache-Control data decremented. Second, third (subsequent) responses are correctly decrementing, but not returning a 304 NOT MODIFED (which I thought might be expected for caching). example: < HTTP/1.1 200 OK < Date: Mon, 14 Jun ...

Add an Expires or a Cache-Control Header in JSP

How do you add an Expires or a Cache-Control Header in JSP. I want to add a far-future expiration date in an include page for my static components such as images, css and .js files. Any help is appreciated. ...

Help with cache control and expiry headers

Sorry if this question sounds a bit basic, I just want to be double sure. I retrieve my images with a URL like so image.jpg?m=54437 The end numbers allow me to cache control it. When the image changes, so do those numbers. I am sending these headers with these images HTTP/1.1 200 OK Date: Thu, 01 Jul 2010 00:54:19 GMT Server: Ap...

iis 6.0: Setting Expires header don't work + cache control

Hi ! from all the articles i read it seems that setting the Expires http header is very easy. i went to the wanted directories(with iis6.0)-->right click-->Http headers--> Enable expires and setting the period-->OK that should do the work, i thought... but when i test my page again with PageSpeed and other tools its teling me that th...

Ruby on Rails: how to set content expiration for 15 minutes if it is an AJAX request

Is the following a good form of detecting AJAX request and setting expiration for 15 minutes so that the same GET will not require any network traffic? # in controller if request.xhr? response.headers['Expires'] = (Time.now + 15.minutes).httpdate response.headers['Cache-Control'] = '' # override any no-cache, must-revalidate end ...

Right out of the box cache-control header filter?

Is there a right of the box cache-control response header filter that will enable me to set those cache headers on my static resources without me having to build my own Filter? It seems like such a common task. Is there a Spring filter ? I am currently using Tomcat 6.0 and using Spring's ShallowEtagHeaderFilter to set etag to my resource...

For cache-control to expire in 10 years, is using doc.css?v=128 exactly the same as doc_v128.css?

When using Cache-Control and Expires header so that a page won't expire in 10 years: Cache-Control: max-age=315360000 Expires: Sun, 19 Jul 2020 18:06:32 GMT will using line 1 have identical result as line 2? <link href="/public/doc.css?v=128" ... > <link href="/public/doc_v128.css" ... > I was thinking maybe some browser will take...

Will caching work if one of the web servers has a clock that is slightly off?

It is said that the web servers' clocks must be identical for the Expires and Cache-Control headers to work? Why is that? Can't they be off by 1 second or a few minutes? If the cache is supposed to be good for 1 year, then won't a time difference of a few minutes or even a few hours not matter on one or some of the web servers? In ht...

What is the risk of having HTTP header "Cache-Control: public"?

The Cache-Control HTTP/1.1 header can specify max-age as well as whether the cache content can be public or private, indicating whether intermediate cache can cache the content. For example, Ruby on Rails's expires_in() defaults to using Cache-Control: private What is the risk of making it public? If it is public, which extra places c...

Why doesn't Safari honor my cache-control directive?

There is a particular page that I would like the browser to always load, particularly when the user presses the browser back button to get to it. So I use the following 'Cache-Control' directive in the header for this page (taking the PHP directly from my code). $headers['Cache-Control'] = 'no-store, no-cache, must-revalidate, max-age=...

Cannot overwrite Cache-Control in PHP

I've moved a older site to a new server, and the client has found a very odd behaviour. Very close to the end, I have this code: if (!$this->cache) { header('Expires: '.gmdate('d M Y H:i:s', 946684800).' GMT'); header('Cache-Control: no-cache'); header('Pragma: no-cache'); } Now the odd thing is the Cache-Control line doe...

Overcome non-cacheability of pages on Firefox

I'm trying to build an extension to Firefox to get a page from a web server and put it in the browser's cache, so that when the user asks for that link, it'll be retrieved directly from the cache, instead of asking to the original web server. But I'm having trouble with some pages which put headers to avoid cacheability, such as "Cache-...

When do cached static files expire if not specified?

In IIS6, I notice that when "Enable content expiration" is not enabled, no cache-related or expiration headers are sent with the response. Yet static content, such as css files are properly returning 304 statuses on subsequent visits. When does this content expire if nothing is specified? Is it browser dependent? ...

Cache-control: private and public

What should a http client do if server returned Cache-Control: private, public ? I have a feeling private should override public, but I can't find a confirmation in the RFC (other than MUST in private and MAY in public). ...

CSV download fails with Internet Explorer on first attempt, works on subsequent attempts.

Hello, this has been throwing me off for too long.. Posted below is our Rails 3 controller. When attempting to access with Internet Explorer the first time, the download prompt fails with a "Unable to download" message. When attempting to access the same URL immediately following, the download prompt works successfully. In any instan...

How necessary it is to use "must-revalidate" in "Cache-Control: no-cache, must-revalidate"

Often I use Cache-Control: no-cache or Cache-Control: max-age=0 The spec says must-revalidate is for max-stale... (the server issue max-stale?) So if for normal web servers, Apache, or Rails with Mongrels, then I think usually there is no max-stale, so must-revalidate is not needed? ...