etag

sails.js: how to disable etags

情到浓时终转凉″ 提交于 2019-12-22 17:42:13
问题 I read this not very new post about disabling some things in sails.js. Specifically what I would like to try out is the disabling of etags. Does anyone know how to disable that in sails.js (0.11.0)? 回答1: You could disable it in the bootstap.js file: // config/bootstrap.js module.exports.bootstrap = function(cb) { // Add this line to access to the Express app and disable etags sails.hooks.http.app.disable('etag'); // It's very important to trigger this callback method when you are finished //

Firefox & IE: Corrupted data when retrieved from cache

孤人 提交于 2019-12-22 10:18:46
问题 I have a request to the server which looks like this: http://localhost/Combine.aspx/flag/file1.js,file2.js,file3.js I have also tried this: http://localhost/Combine.aspx/flag/value/file1.js/file2.js/file3.js It simply combines the three files which it was given: this works fine. Upon the first request from Firefox, the page displays correctly. When the page is refreshed again, the content looks like this: ��������`I�%&/m�{J�J��t��`$�����iG#)�*��eVe]f@�흼��{���{��;�N' In that case, no request

Why responses to PUT requests MUST NOT provide an ETag?

巧了我就是萌 提交于 2019-12-22 08:24:12
问题 From Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content: An origin server MUST NOT send a validator header field (Section 7.2), such as an ETag or Last-Modified field, in a successful response to PUT unless the request's representation data was saved without any transformation applied to the body (i.e., the resource's new representation data is identical to the representation data received in the PUT request) and the validator field value reflects the new representation. This

Handling eTags on iPhone

≯℡__Kan透↙ 提交于 2019-12-22 06:49:07
问题 Any idea how to handle eTags at client side? We are planning to use eTags with images in our application which are coming from the server. For what is eTag please see this: http://en.wikipedia.org/wiki/HTTP_ETag 回答1: Starting points for your study ... NSMutableURLRequest Here you can set eTag value for you request. [self addValue:eTag forHTTPHeaderField:@"If-None-Match"]; This request is usable with NSURLConnection. NSURLConnectionDelegate Delegate of your NSURLConnection has method ... -

Chrome is not sending if-none-match

孤人 提交于 2019-12-21 06:58:47
问题 I'm trying to do requests to my REST API, I have no problems with Firefox, but in Chrome I can't get the browser to work, always throws 200 OK , because no if-none-match (or similar) header is sent to the server. With Firefox I get 304 perfectly. I think I miss something, I tried with Cache-Control: max-age=10 to test but nothing. 回答1: One reason Chrome may not send If-None-Match is when the response includes an "HTTP/1.0" instead of an "HTTP/1.1" status line. Some servers, such as Django's

IE 9+ ignores ETag value change and returns cached response

一个人想着一个人 提交于 2019-12-21 04:05:16
问题 The Etag provided cache validation that works well with FF & chrome, but IE seems to ignore the Etag value and always returns the cached response. The server response is: HTTP/1.1 200 OK Date: Mon, 07 Jul 2014 06:01:57 GMT Content-Type: application/json ETag: a7628382056ddd13b7e06991571fd3ad Content-Encoding: gzip Content-Length: 4360 when client sends a conditional get request If-None-Match: 71fb49ecd6f85545693dec0e78ae2131 The request is not sent at all and IE returns the cached response.

Browser support for eTags

痴心易碎 提交于 2019-12-20 10:01:12
问题 I'm working on getting my site to support the eTag/If-None-Match browser cache, but I'm not sure which browsers do/don't support it. Can anyone point me to a list? I can't imagine it's universal, but I haven't found anything that supports that claim. cheers, Mike 回答1: If-None-Match was Specified in HTTP 1.1 (June 1999): http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol According to Wikipedia: By March 1996, pre-standard HTTP/1.1

HTTP ETags and HTTP Redirects

主宰稳场 提交于 2019-12-19 22:10:15
问题 I have a webserver that issues the ETag header on responses and checks the If-None-Match header from the client, if present. The client in this case, is not a web browser but an extension of go's builtin net/http http.Client type. Here is my code package util import "net/http" import "net/url" type HttpClient struct { http.Client etags map[url.URL]string } func (hc *HttpClient) Do(req *http.Request) (*http.Response, error) { const ETAG_SERVER_HEADER = "ETag" const ETAG_CLIENT_HEADER = "If

高性能网站建设指南----笔记

随声附和 提交于 2019-12-19 02:00:28
小概述: 1.只有10%-20%的最终用户响应时间花在了下载HTML文档上,其余的80%-90%的时间花在了下载页面中的所有组件上【js,css,image,flash...】。 2.如果浏览器和服务器都支持的话,可以使用压缩来减小响应的大小。浏览器可以使用Accept-Encoding头来声明它支持的压缩,服务器使用Content-Encoding头来确认响应已被压缩。 3.条件GET请求 如果浏览器在其缓存中保留了组件一个副本,但并不确定它是否仍然有效,就会生成一个条件GET请求,即在请求头中使用If-Modified-Since头将最后修改时间发送给服务器,请求服务器验证该副本从最后修改时间以来有没有被更新过,如果 没有更新过,服务器会返回一个"304 Not Modified"状态码并不再发送响应体,浏览器直接使用缓存中的这个副本,从而得到一个更小且更快的响应。 请求: GET /us.js.yimg.com/lib/common/utils/2/yahoo_2.0.0-b2.js HTTP/1.1 Host: us.js2.yimg.com User-Agent: Mozilla/5.0 (...) Gecko/20061206 Firefox/1.5.0.9 Accept-Encoding: gzip,deflate If-Modified-Since: Wed, 22

How to turn off Etag with htaccess?

穿精又带淫゛_ 提交于 2019-12-18 19:06:49
问题 One of my friend says, etags on off mode for speed up page loading. How to off etags with htaccess? 回答1: To unset Etags use 3 lines below: Header unset Pragma FileETag None Header unset ETag But, to increase page loading speed, my advice is YSlow. perfect tool & Yslow recommends to use Etags instead of setting off. 回答2: Putting the following in your .htaccess should do the trick. Header unset ETag FileETag None Note: Disabling etags only helps if you are hosting the same content from more