if-modified-since

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

筅森魡賤 提交于 2019-11-27 21:16:38
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 Have you checked the request headers? "‘Cache-Control’ is always set to ‘max-age=0′, no matter if you press enter, f5 or ctrl+f5. Except if you start Chrome and enter the url and press enter." http://techblog.tilllate.com/2008/11/14/clientside-cache-control/ With chrome it

Handling If-modified-since header in a PHP-script

狂风中的少年 提交于 2019-11-27 04:07:20
I have a PHP script which is called with an ?img= parameter. The value for that parameter is an (urlencoded) URL of an image. My script checks, if that image is already stored at my server. If not - it downloads it. After that it optionally resizes the image and sends it to STDOUT, i.e. back to the requesting browser, prepended with Content-Type and Last-modified headers: Connection:close Content-Type:image/jpeg Date:Fri, 01 Jun 2012 08:28:30 GMT Last-Modified:Fri, 01 Jun 2012 08:02:44 GMT Server:Apache/2.2.15 (CentOS) Transfer-Encoding:chunked X-Powered-By:PHP/5.3.3 This is needed to

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

女生的网名这么多〃 提交于 2019-11-26 20:24:39
问题 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 回答1: Have you checked the request headers? "‘Cache-Control’ is always set to ‘max-age=0′, no matter if you press enter, f5 or ctrl+f5. Except if you start Chrome and

Handling If-modified-since header in a PHP-script

烈酒焚心 提交于 2019-11-26 11:03:16
问题 I have a PHP script which is called with an ?img= parameter. The value for that parameter is an (urlencoded) URL of an image. My script checks, if that image is already stored at my server. If not - it downloads it. After that it optionally resizes the image and sends it to STDOUT, i.e. back to the requesting browser, prepended with Content-Type and Last-modified headers: Connection:close Content-Type:image/jpeg Date:Fri, 01 Jun 2012 08:28:30 GMT Last-Modified:Fri, 01 Jun 2012 08:02:44 GMT

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

偶尔善良 提交于 2019-11-26 08:56:03
问题 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 (the page seems to have disappeared, see an archive copy at the Wayback Machine). 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 my browsers request, and then proxies it on by creating a new HttpWebRequest,