if-modified-since

Refresh image with Javascript, but only if changed on server

I want to reload an image on a page if it has been updated on the server. In other questions it has been suggested to do something like newImage.src = "http://localhost/image.jpg?" + new Date().getTime(); to force the image to be re-loaded, but that means that it will get downloaded again even if it really hasn't changed. Is there a...

Read If-Modified-Since header in PHP CGI

My PHP script depends on being able to read the value of the If-Modified-Since header (yes, I know how to do this). It worked correctly when I used PHP as mod_php, but now that I've switched to suPHP (CGI), it appears Apache itself handles requests that contain this header, without forwarding them to PHP at all. This is silly, because...

Get Browser to send both If-None-Match and If-Modified-Since

My Browser isn't sending back an If-Modified-Since Header for PHP generated Content on the first request my script sends: (Status-Line) HTTP/1.1 200 OK Date Thu, 21 Jan 2010 08:55:25 GMT Server Apache/2.2.11 (Win32) PHP/5.2.9-1 X-Powered-By PHP/5.2.9-1 Pragma no-cache x-ua-compatible IE=8;FF=3;OtherUA=4 Last-Modfied Sat, 02 Jan 2010 02...

What is the point of If-Unmodified-Since/If-Modified-Since? Aren't they superseded by ETags?

There seem to be two distinct ways to implement conditional requests using HTTP headers, both of which can be used for caching, range requests, concurrency control etc...: If-Unmodified-Since and If-Modified-Since, where the client sends a timestamp of the resource. If-Modified and If-None-Modified, where the client sends an ETag repre...

Why am I getting "(304) Not Modified" error on some links when using HttpWebRequest?

Hi, Any ideas why on some links that I try to access using HttpWebRequest I am getting "The remote server returned an error: (304) Not Modified." in the code? The code I'm using is from Jeff's post here. Note the concept of the code is a simple proxy server, so I'm pointing my browser at this locally running piece of code, which gets ...

(Weak) ETags and Last-Modified

As far as I understand the specs, the ETag, which was introduced in RFC 2616 (HTTP/1.1) is a predecessor of the Last-Modified-Header, which is proposet to give the software-architect more controll over the cache-revalidating process. If both Cache-Validation-Headers (If-None-Match and If-Modified-Since) are present, according to RFC 261...

Browser caching after login/logout

I've got a site with a basic login/logout system. When I display pages I do a check to see when the page was last modified and if the browser has sent an if modified since header. If it hasn't been modified I send a 304 header and exit. This obviously loads the page alot quicker and means less memory and processing power for me as I do...

Is there an existing solution for WebRequest caching in .NET (based on If-Modified-Since)?

I have an expensive WebRequest that I know can be cached. Is there an existing solution that allows caching of web requests based on Last-Modified/If-Modified-Since and (optionally) ETags? ...

Chrome - why is it sending if-modified-since requests?

I have a page with lots of small images (icons). When used with chrome, each time the page is reloaded, chrome requests each icon from the server with if-modified-since header. All icons are served with expires and max-age headers. Firefox loads images from its cache. Why is chrome doing that and how can I prevent it? Thanks ...