etag

你知道 http 响应头中的 ETag 是如何生成的吗

让人想犯罪 __ 提交于 2019-12-10 23:29:35
关于 etag 的生成需要满足几个条件 当文件不会更改时, etag 值保持不变。所以不能单纯使用 inode 便于计算,不会特别耗 CPU。这样子 hash 不是特别合适 便于横向扩展,多个 node 上生成的 etag 值一致。这样子 inode 就排除了 关于服务器中 etag 如何生成可以参考 HTTP: Generating ETag Header 那么在 nginx 中的 etag 是如何生成的? nginx 中 ETag 的生成 我在网上找到一些资料与源代码了解到了 etag 的计算方法。由 python 伪代码表示计算方法如下 etag = '{:x}-{:x}'.format(header.last_modified, header.content_lenth) 源码: ngx_http_core_modules.c etag->value.len = ngx_sprintf(etag->value.data, "\"%xT-%xO\"", r->headers_out.last_modified_time, r->headers_out.content_length_n) - etag->value.data; 总结: nginx 中 etag 由响应头的 Last-Modified 与 Content-Length 表示为十六进制组合而成。

Programatically removing etag suffix (change number) from the metabase IIS6

霸气de小男生 提交于 2019-12-10 20:16:25
问题 IIS 6.0 generates eTag values in the format of "hash:changenumber". The changenumber goes up every time IIS resets, so your eTag is only valid for the lifetime of your IIS process. Restart, number goes up, hash:changenumber != hash:changenumber+1. The fix for this is to hard-code the changenumber, which is possible using the Metabase Explorer, a .NET utility for editing the metabase, or by editing the XML file when the IIS services are stopped. I want to do this programmatically, with the

Generating etags for images in asp.net?

家住魔仙堡 提交于 2019-12-10 19:33:39
问题 On my site, users can upload images that are displayed publicly. When the user uploads a new image, it overwrites one of their old images. Because the images can be large, I want them to be cached. However, when the user uploads a new image, the old cached images should not be used. The source of the dynamic images looks like this: userImage.ashx?id=f488b864-0a0b-46d9-af4a-a43cd0dcf751&type=micrositePhoto So I can inject headers into the response in the .ashx file if I need to. I've been told

using ETag but the status code is always 200 and not 304

不问归期 提交于 2019-12-10 19:01:17
问题 When I try to request for the the http://graph.facebook.com/me?fields=friends with the ETag I always get the request code as 200 every time. we I made two back to back response and checked it. The change was at the end it had a section for pagination and it attached a access token. which is always different so the ETag value also changes. I am using google app engine to host my app. and using URLFetech to make the request. <code> String ETag = FBUser.getProperty("ETag").toString();<br> String

Is there a way to get emacs tag-search command to output all results to a buffer?

不问归期 提交于 2019-12-10 14:57:27
问题 Is there a way to get Emacs tags-search command to collect all search results in a buffer? Something like the way results from 'grep' and 'tags-apropos' are collected in a compilation buffer? Using M-, to iterate over the results isn't very effective if there are a large number of hits, so it'd be great if there was a way to browse and search through the results in a buffer. Thanks, Benj 回答1: Try etags-select 回答2: I misinterpreted your question in my first answer. Here's something that works,

Apache + Etags -> returns 200 and send content instead of 304

旧街凉风 提交于 2019-12-10 09:33:38
问题 I have this Apache conf that uses Etags: <VirtualHost *:8080> ServerName xxx.co SSLEngine On SSLProtocol all -SSLv2 SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM SSLCertificateFile /etc/apache2/xxx.crt SSLCertificateKeyFile /etc/apache2/xxx.key SSLCertificateChainFile /etc/apache2/sub.class1.server.ca.pem SSLCACertificateFile /etc/apache2/ca.pem SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown ServerAdmin edward@xxx.co DocumentRoot /home/ubuntu/xxx-react/build/

Ruby on Rails, how to disable/turn off ETag

别说谁变了你拦得住时间么 提交于 2019-12-10 03:38:03
问题 Greetings, How do I turn off ETag(s) in Ruby on Rails v2.3.5 When I do a direct request to to the RoR/Mongrel an ETag header is present. TIA, -daniel 回答1: much easier: config.middleware.delete Rack::ETag 回答2: Putting response.etag = nil in a before_filter does not work. The etag is generated just before the response is send (it's caluculated from the body so after all rendering has been done). The proper workaround to disable etag use and generation (and so save the time spend in md5) it this

Where does the W/ in an etag appear from?

╄→гoц情女王★ 提交于 2019-12-09 23:00:09
问题 I am confused by how the W/ appears in the etag when I have not added it. I am using Node.js http server module and have a Nginx as reverse proxy. I am getting the browser see the Etag generated by the Node.js server but with a W/ tagged to it. Can someone explain where that W/ comes from? Does the browser insert that based upon its determination that it is a weak etag? I want the browser to get it as I sent it. Without the W/ prefix. Here is the Etag header as seen in the browser. etag: W/

HTTP: max length of etag

╄→尐↘猪︶ㄣ 提交于 2019-12-09 14:09:32
问题 Does the HTTP protocol specify a max length for the ETag? 回答1: No. 14.19 ETag The ETag response-header field provides the current value of the entity tag for the requested variant. The headers used with entity tags are described in sections 14.24, 14.26 and 14.44. The entity tag MAY be used for comparison with other entities from the same resource (see section 13.3.3). ETag = "ETag" ":" entity-tag Examples: ETag: "xyzzy" ETag: W/"xyzzy" ETag: "" 回答2: No, an entity-tag is a quoted-string with

rest - relations and etag

六眼飞鱼酱① 提交于 2019-12-08 10:19:33
问题 Say I have two root resources: /organizations /persons A GET call on /persons/id returns all the information about a certain person. A GET call on /persons/id/organizations returns an array of all the organizations a persons belongs to. A GET call on /persons/id/organizations/id returns all the information of a specific organization the person belongs to. It returns the same content as in /organizations/id . There is a possibility to extend the person information with its organizations