http-caching

Problem with caching

I have an a aspx page, but all content is generated by hands(yes I know that I need to make a handler, I have another question) I want to cache output in client browser. Problem is that it's cached only for one query. public static void ProceedCaching(string etag, string lastModify, string response, HttpResponse Response, ...

Tomcat: Caching SWF files with varying query strings

I'm current loading my SWF from a JSP, and passing parameters to it via query string (e.g. flash.swf?key=1234abcd) which works fine. The problem is that this appears to disable caching completely. My users will likely visit my Flash app with a different query string every time, which will lead to long load times. I see in the headers th...

Browser cache behaviour for redirects

I'm trying to figure out if redirecting all www.example.com requests to example.com will be beneficial for caching or not, to which end I have 2 questions. SEO is not an issue here. If the browser requests an image from the www URL (#1) and gets HTTP redirected to the www-less version (#2), will it store the result as cache value for j...

Leverage browser caching

I have a website and when I check page speed with Google plug-in, I receive: Leverage browser caching The following resources are missing a cache expiration Searching only returns information on using htaccess under Apache, but my site is running on Windows 2003 Server, in plain HTML language, and I don't even have access to the ...

How to use CXF, JAX-RS and HTTP Caching

The CXF documentation mentions caching as Advanced HTTP: CXF JAXRS provides support for a number of advanced HTTP features by handling If-Match, If-Modified-Since and ETags headers. JAXRS Request context object can be used to check the preconditions. Vary, CacheControl, Cookies and Set-Cookies are also supported. I'm really interes...

Css background images not being cached by FireFox

I am dynamically adding <link> tags to the page using YUI3 and this works properly. For testing purposes I have two nearly identical css files which include the exact same background images however when I load the second css file, Firebug shows that more http requests are being made for the same images in the first css file. The JS Y...

Does the `Expires` HTTP header needs to be consistent across multiple cold-cache requests?

I'm implementing a custom web server of a kind. And am looking into adding an Expires header support. However, I'm a little unsure of how exactly to implement it. If multiple cold-cache requests are being made to the same unchanged resource on the server and the server returned different Expires header (say it uses relative time to calc...

Why is a file requested through https after it has already been fetched through http?

Hi all, I am trying to understand Http/Https a little better and possibly what headers I'm sending clients. Does the client have to re-fetch the same file under Https when it has already been fetched under Http, or do I need to send special headers? Well, the reason the file is served over http/https is that it is simply a banner. Wh...

REST: Should I redirect to the version URL of an entity?

I am currently working on a REST service. This service has an entity which has different versions, similar to Wikipedia articles. Now I'm wondering what I should return if for GET /article/4711 Should I use a (temporary) redirect to the current version, e.g. GET /article/4711/version/7 Or should I return the current version direct...

Website files caching?

I want to know how long certain files like css, html and js are desirable to be cached by .htaccess setting and why different time setting for each file type? In few examples i saw that someone cache html for 10 mins, js for a month and imagery for a year. ...

How can I force PHP's fopen() to return the current version of a web page?

The current content of this google docs page is: However, when reading this page with the following PHP fopen() script, I get an older, cached version: I've tried two solutions proposed in this question (a random attribute and using POST) and I also tried clearstatcache() but I always get the cached version of the web page. What d...

Cache-Control and Expires doesn't Work

Hi, I set up cache-control and expires headers via .htaccess but already it doesn't load from browser cache. When i enter the uri, i am waitting for load from web site. URI: http://www.btgmaslak.com/static/images/main_container_background_11.jpg ...

How do you cache a file client-side such that the browser stops even bothering to request it again?

I send back an image with the following HTTP response header: Cache-Control: private,max-age=86400 My understanding is that the browser should not even ask for this file for 24 hours (86,400 = 60s * 60m * 24h). What I'm seeing on subsequent requests is that it still asks for the file, but gets back a "304 Not Modified." This is good...

How do I set Expires: header when using send_data

I have a method in my controller which uses send_data like this: def show expires_in 10.hours, :public => true send_data my_image_generator, :filename => "image.gif", :type => "image/gif" end Using expires_in results in headers being sent like this: HTTP/1.1 200 OK Connection: close Date: Fri, 25 Jun 2010 10:41:22 GMT ETag: "885d...

ASP.NET: How to enforce a reload of a web static file

When doing webpages, the client/browser decides if it updates a file like an image or .css or .js or if it takes that from the Cache. In case of .aspx page it is the server who decides. Sure, on IIS level or also using some HttpModule techniques I can change the headers of requests to tell the client if and how long a file should be ...

How to make HTTP Cache Headers Work

Hi, Can someone please help me with a HTTP caching question? I thought that if I set the "Expires" and "Cache-Control:max-age" request headers, then a browser wouldn't make a GET request until after the max-age had passed? My server is seeing lots of conditional GET requests, and it replies with a 304. However, I'd like to eliminate t...

setting cache headers in .htaccess file

I put the following code in my .htaccess file. But when I run my application, I get server error. I put the code to improve my site's performance. RewriteEngine On RewriteBase /domainname/site/ RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-...

Using ASP.NET HttpCache to buffer data from a web service

What problems might I encounter by using the HttpCache to buffer data from a web service, as opposed to storing the same data in a database table? In a hypothetical situation whereby the service was temporarily unavailable, if the server needed to reboot during that time there would be no way to re-populate the cache. So for that reason,...

IE ignoring updated cache control headers

I have a website which currently allows caching of its images, however, there was a decision to no longer allow caching. So I proceded to add cache-control and Expires headers to the response header. I noticed however that IE still sends out a conditional request on the images and the server responds with a 304 response. In the 304 ...

Difference between three .htaccess expire rules

What's the difference between the following three .htaccess rules and when to use each, is there any special use cases that prefers one over the other?: Header set Cache-Control "max-age=290304000" Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT" ExpiresDefault "access plus 10 years" ...