cache-control

Why browser does not send “If-None-Match” header?

醉酒当歌 提交于 2019-11-30 03:37:58
I'm trying to download (and hopefully cache) a dynamically loaded image in PHP. Here are the headers sent and received: Request: GET /url:resource/Pomegranate/resources/images/logo.png HTTP/1.1 Host: pome.local Connection: keep-alive Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.22 (KHTML, like Gecko) Ubuntu Chromium/25.0.1364.160 Chrome/25.0.1364.160 Safari/537.22 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie:

how does a etag work in expressjs

末鹿安然 提交于 2019-11-30 02:42:56
Expressjs automatically send etags. I would like to know how the etag is generated..is it based on the content that is generated dynamically by the get routine. or is there way I can mainpulate it, by not even going through the process of generating the content(dynamic content - from DB) and pass back etag as same. may be a middleware which start with just checking if it is valid session id and pass back the same etag that the client gives or may be based of the url + session id..that way it will be unique. and end the request there rather going through the whole db call and all those stuff.

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

时光怂恿深爱的人放手 提交于 2019-11-30 02:42:40
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 can cache the content -- would it be a proxy server, for example? What if the website is like Amazon.com, but the user is anonymous, then probably there is not much privacy issue? What if the user is logged in, could there be privacy issue, because the data passes

Expires vs max-age, which one takes priority if both are declared in a HTTP response?

。_饼干妹妹 提交于 2019-11-30 01:21:08
If a HTTP response that returns both Expires and max-age indications which one is used? Cache-Control: max-age=3600 Expires: Tue, 15 May 2008 07:19:00 GMT Considering that each one refers to a different point in time. Peter O. See this answer: Difference between three .htaccess expire rules If a response includes both an Expires header and a max-age directive, the max-age directive overrides the Expires header , even if the Expires header is more restrictive. This rule allows an origin server to provide, for a given response, a longer expiration time to an HTTP/1.1 (or later) cache than to an

Flask static file Cache-Control

我的未来我决定 提交于 2019-11-30 00:42:36
问题 I'm trying to set a reasonable cache expiry for my JS files while in development. I have the standard setup, where HTML, CSS and JS are living under the static directory. The docs do mention this, but for the life of me I cannot get this to work. I've tried both methods implied, first class MyFlask(flask.Flask): def get_send_file_max_age(self, name): if name.lower().endswith('.js'): return 60 return flask.Flask.get_send_file_max_age(self, name) app = MyFlask(__name__) and app.config['SEND

How do you disable caching with WebClient and Windows Phone 7

折月煮酒 提交于 2019-11-29 13:32:00
I am making a call to a REST web service and the mobile app is retrieving the results from its cache and not going to the server. I have seen other suggested fixes ( similar issue and similar issue2 ) but the Cache property is not available in silverlight 4. Does anyone have an idea of how to force silverlight 4 on windows phone 7 to make a request and not hit the cache? Although not ideal, a easy solution is to send something like the field "junk" with the value DateTime.Now . That way, a value is always brand new, and will never get cached. If you were doing this in a standard querysting for

What's the difference Expires and Cache-control:max-age?

守給你的承諾、 提交于 2019-11-29 11:59:29
问题 Could you tell me the difference of Expires and Cache-control:max-age? 回答1: Expires was defined in the HTTP/1.0 specifications, and Cache-Control in the HTTP/1.1 specifications. I would suggest defining both so you cater to both, the older clients that only understand HTTP/1.0 , and the newer ones. 回答2: Expires was specified in HTTP 1.0 specification as compared to Cache-Control: max-age, which was introduced in the early HTTP 1.1 specification. The value of the Expires header has to be in a

Proxy cacheing - What about cookies? [closed]

时光毁灭记忆、已成空白 提交于 2019-11-29 11:26:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I read http://code.google.com/speed/page-speed/docs/caching.html. It says that proxy servers may cache cookies. I need clarification. Let's say I have this header for my files: Cache-Control "max-age=604800, public" Q.1. With this header, will the cookies from a person's computer be cached on the proxy server

set cache-control to external resources?

喜你入骨 提交于 2019-11-29 06:11:40
@tools.pingdom.com I get a warning in leverage cache-control because of these resources: http://code.jquery.com/jquery-1.6.2.min.js http://www.google-analytics.com/ga.js http://edge.sharethis.com/images/spinner.gif http://w.sharethis.com/button/buttons.js Which are not in my host. What can I do about this? This is the beginning of my htaccess: # 480 weeks <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|css|swf)$"> Header set Cache-Control "max-age=290304000, public" </FilesMatch> # 1 weeks <FilesMatch "\.(js)$"> Header set Cache-Control "max-age=604800, public" </FilesMatch> Corbin You can't

ASP.NET browser shows “web page has expired” for back button (after a post back)

孤街浪徒 提交于 2019-11-29 04:38:38
I'm having trouble with a simple ASP.NET application and the back button after a post back. The page in question has a simple form on it, some text fields etc, and a dropdown that does a postback (autopostback). The "normal" flow is the user fills out the form and perhaps changes the dropdown. Based on the dropdown value the page content might change. The problem I'm having is that after the user has changed the dropdown and the postback has completed then the user clicks the back button. They see a "webpage has expired" message from IE. I've set the following: Response.Cache.SetExpires