etag

Parsing JSON Object in Salesforce Apex

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: How do I parse a jsonObject which is in a given format in Apex? I need List<String> from the items array which contains the id attribute. What is some appropriate method? For parsing it, I try to create a class with code: public class JSON2Apex { public class Items { public String kind; public String etag; public String id; public String status; public String htmlLink; public String created; public String updated; public String summary; public String description; public String location; public Creator creator; public Creator organizer;

CDN缓存

匿名 (未验证) 提交于 2019-12-03 00:37:01
当web应用关系复杂,数据表蹭蹭蹭往上涨时,可以将查询后的数据放到内存中进行缓存,下次再查询时,就直接从内存缓存中获取,从而提高响应速度。 CDN通俗点,就是当我们发送一个web请求时,会先经过它一道手,然后它帮我们计算路径,去哪得到这些东东(representations)的路径短且快。这个是网站管理员部署的,所以他们也可以将大家经常访问的representations放在CDN里,这样,就响应就更快了。 代理服务器缓存,其实跟下面即将讲的浏览器缓存性质差不多,差别就是代理服务器缓存面向的群体更广,规模更大而已。即,它不只为一个用户服务,一般为大量用户提供服务,同一个副本会被重用多次,因此在减少相应时间和带宽使用方面很有效。 简而言之,就是,每个浏览器都实现了 HTTP 缓存,我们通过浏览器使用HTTP协议与服务器交互的时候,浏览器就会根据一套与服务器约定的规则进行缓存工作。当我们点击浏览器上‘后退’或者‘前进’按钮时,显得特别有用。 Etag & If-None-Match Etag是属于HTTP1.1属性,是服务器生成返回给前端 当你第一次发起HTTP请求时,服务器会返回一个Etag 当你第二次发起同一个请求时,客户端会同时发送一个If―None-Match,它的值就是Etag(请求的发起是客户端设置) 服务器对比客户端发送来的Etag是否与服务器的相同,相同就返回304

HTTP请求的缓存(Cache)机制

匿名 (未验证) 提交于 2019-12-02 23:34:01
先来一张图: #### 下面简单的来描述一下HTTP Cache机制 : 当资源资源第一次被访问的时候,http status返回200,在头部携带当前资源的描述信息,eg: 最后修改的时间:```Last-Modified``` 资源状态唯一标识:```Etag``` 资源在客户端缓存的过期时间:```Expires``` 同时浏览器会将资源缓存到cache目录,并保存文件描述信息。 当客户端第二次请求资源时,会先检查cache目录中是否含有该资源,如果有,并且还没到Expires设置的时间, 即文件还没有过期,那么此时客户端将直接从Cache目录中读取文件,而不再发送请求 如果资源已经过期,客户端会发送一次http请求到服务器,同时在header携带上次修改的时间: ```text If-Modified-Since Thu, 26 Nov 2009 13:50:19 GMT If-None-Match "8fb8b-14-4794674acdcc0" ``` 如果你对编程感兴趣或者想往编程方向发展,可以关注微信公众号【筑梦编程】,大家一起交流讨论!小编也会每天定时更新既有趣又有用的编程知识! #### 为什么会返回上一次的信息呢? web服务器在接收到请求时,会先解析header里面的信息,然后校验头部信息。 如果该资源文件从上次时间到现在都没有修改或者Etag信息没有变化,

Browser support for eTags

蓝咒 提交于 2019-12-02 21:17:05
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 Steve 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 was supported in Arena, Netscape 2.0, Netscape Navigator Gold 2.01, Mosaic 2.7, Lynx 2.5, and in

(Weak) ETags and Last-Modified

天大地大妈咪最大 提交于 2019-12-02 20:38:14
As far as I understand the specs, the ETag, which was introduced in RFC 2616 (HTTP/1.1) is a successor (of sorts) for 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 2616, the client (i.e. the browser) should use the ETag when checking, if a resource has changed. According to section 14.26 of RFC 2616, the server MUST NOT respond with a 304 Not Modified, if the ETag presented in a If-None-Match-Header has changed, and

How to configure ETag on Nginx

蹲街弑〆低调 提交于 2019-12-02 18:09:19
I'm using Nginx as a webserver and want to implement a browser caching method so that the users keep copies of static unchanged files locally and download only changed files. One of the propositions was to use the files timestamp to figure out the changed files and refresh them only, but this is not possible in my case since after every new deploy a new version of the whole web application is created and all the files' timestamps change. I researched a little about the ETag header, and it seemed as a pretty good solution, but I found out that Etags are not officially supported by Nginx yet.

Configuring ETags with Http module in asp.net

懵懂的女人 提交于 2019-12-01 20:34:01
i'm optimizing our company web site with seo optimization and yslow. but in yslow the ETAGS are F . I've gone through tens of web sites and tutorials and the best option was using an HTTP Module. I've done so and tried several modules but none shows results.maybe something in syntax is wrong or i'm registering it wrong .some say it is best to use app_PostReleaseRequestState instead of OnPreSendRequestHeaders because of a crash in heap.I've used both with no results. here it is : the file name is etag and it is in app-code folder web config : <system.webServer> <modules

浏览器 HTTP 协议缓存机制详解

孤者浪人 提交于 2019-12-01 15:06:05
最近在准备优化日志请求时遇到了一些令人疑惑的问题,比如为什么响应头里出现了两个 cache control、为什么明明设置了 no cache 却还是发请求,为什么多次访问时有时请求里带了 etag,有时又没有带?等等。。。 后来查了一些资料以及同事亲自验证,总算对这些问题有了个清晰的理解,现在整理出来以备忘。 1、缓存的分类 缓存分为服务端侧(server side,比如 Nginx、Apache)和客户端侧(client side,比如 web browser)。 服务端缓存又分为 代理服务器缓存 和 反向代理服务器缓存(也叫网关缓存,比如 Nginx反向代理、Squid等),其实广泛使用的 CDN 也是一种服务端缓存,目的都是让用户的请求走”捷径“,并且都是缓存图片、文件等静态资源。 客户端侧缓存一般指的是浏览器缓存,目的就是加速各种静态资源的访问,想想现在的大型网站,随便一个页面都是一两百个请求,每天 pv 都是亿级别,如果没有缓存,用户体验会急剧下降、同时服务器压力和网络带宽都面临严重的考验。 2、 浏览器缓存机制 详解 浏览器缓存控制机制有两种:HTML Meta标签 vs. HTTP头信息 2.1 HTML Meta标签控制缓存 浏览器缓存机制,其实主要就是HTTP协议定义的缓存机制(如: Expires; Cache-control等)

Safari not sending “If-Modified-Since” and “If-None-Match” headers

别说谁变了你拦得住时间么 提交于 2019-12-01 03:01:15
I'm generating dynamic content with PHP. I'm sending the following HTTP-header: HTTP/1.1 304 Not Modified Date: Sun, 09 Dec 2012 17:24:41 GMT Server: Apache Connection: keep-alive, Keep-Alive Keep-Alive: timeout=1, max=100 Etag: "237f43b800e655dbe6567f7d32d34c99" Expires: Sun, 16 Dec 2012 17:24:41 GMT Cache-Control: max-age=604800 Vary: Accept-Encoding I later check for the Etag to send a header('HTTP/1.1 304 Not Modified') if it matches. This works perfectly with Chrome and Firefox. However, Safari (Version 6.0.2) does not send "If-Modified-Since" and "If-None-Match" headers. This is the

How to use Windows Azure Table Storage Timestamp or Etag field

谁都会走 提交于 2019-12-01 00:38:25
I am developing a node.js application on Windows Azure Websites (IISNode) and have installed the Azure SDK module for node.js my question is how to use the etag or timestamp field in table storage. Is it a matter of "me" doing something e.g: if (entities[0].Timestamp == newEntity.Timestamp) // commit this update because we are dealing with the latest copy of this entity else // oops! one of the entities is newer than the other, better not save it Or do I need to listen for a error returned by the tableService.updateEntity( ... for an error returned or something ? Any help or advice appreciated