Semantics Built-in. Semantics and ARIA. Responsive Web Design. Install Prompts. Device APIs. Sign in and Credential Management.
User Input. Web Push Notifications. Video and Audio Playback. Playback Control with Media Source Extensions. Capture and Record.
Manipulating Media Files. Loading Performance. Get Started. Optimizing Content Efficiency. Optimizing JavaScript. Never Load the Same Resource Twice.
Web Storage. Lazy Loading Resources. Order Loading Thoughtfully. Critical Rendering Path. Web Performance Optimization with webpack. Rendering Performance. Audit your site. Encrypting Data In Transit. Preventing Mixed Content. Help, I've been hacked. Assess spam damage. Base Technologies. Web Components. Service Workers. Chrome Dev Summit is back! In addition to caching, revalidation is an important concept as well. Caution: Browser testing:. When testing caching in Google Chrome, if you are testing over https and you have a self-signed certificate, nothing will get cached.
Chrome won't cache responses or perform revalidation when there is an untrusted or invalid certificate. There is an issue with AEM Dispatcher v4. This means that even when private or s-maxage directives are set it would still cache if max-age is set. This issue is resolved in Dispatcher 4.
A CDN or "Content Delivery Network" , is a distributed network of web servers designed to cache and serve content from the location nearest to your users. This reduces network hops and distance from the user's computer to your content, thereby reducing "Round Trip Time" RTT. RTT is the time it takes for the browser to send a request to your site and receive a response.
This makes the decision of using a CDN for your site an easy one. There are many CDN providers, each one offers different features and configurations. CDNs cache content following rules similar to browsers. Most CDNs provide some way to trigger a manual flush of the cache.
In many cases, cache flushes have some delay e. Caution: Be careful for the Vary response header. In certain cases, Vary can cause both the CDN and browser to skip caching entirely. As a general rule of thumb, avoid adding Vary except for Vary: Accept-Encoding applied only when the response is gzip compressed.
You can save time by using space to store results. In the case of websites, the browser can save a copy of images, stylesheets, javascript or the entire page. Fewer downloads means a faster, happier site. Caching seems fun and easy. The browser saves a copy of a file like a logo image and uses this cached saved copy on each page that needs the logo.
This avoids having to download the image ever again and is perfect, right? What happens when the company logo changes? Google becomes Quadrillion? After all, the file may have changed on the server and there could be an updated version. One fix is for the server to tell the browser what version of the file it is sending.
Now the browser knows that the file it got logo. The next time the browser needs logo. Caching saves the day err… the bandwidth. Comparing versions with the modification time generally works, but could lead to problems. The caches could be inaccurate. ETags to the rescue. An ETag is a unique identifier given to every file.
The ETag can be any string which uniquely identifies the file. ETags work great. Caching a file and checking with the server is nice, except for one thing: we are still checking with the server. If we know when the milk logo. As soon as it goes expires, we contact the server for a fresh copy, with a new expiration date.
The header looks like this:. Expires is great, but it has to be computed for every date.
0コメント