• About
  • Advertise
  • Privacy & Policy
  • Contact
Tech News, Magazine & Review WordPress Theme 2017
  • Home
  • Computers
  • Games
  • Internet
  • Image
  • Top downloads
No Result
View All Result
  • Home
  • Computers
  • Games
  • Internet
  • Image
  • Top downloads
No Result
View All Result
Flickroom
No Result
View All Result
Home Others

Serve static assets with an efficient cache policy

Share on FacebookShare on Twitter

Share

Serve static assets with an efficient cache policy

May 2, 2019

•

Reading: Serve static assets with an efficient cache policy

Updated Oct 4, 2019 Appears in :Performance audits HTTP hoard can speed up your page warhead time on repeat visits. When a browser requests a resource, the server providing the resource can tell the browser how hanker it should temporarily store or cache the resource. For any subsequent request for that resource, the browser uses its local copy preferably than getting it from the net .

How the Lighthouse cache policy audit fails #

Lighthouse flags all static resources that are n’t cached :A screenshot of the Lighthouse Serve static assets with an efficient cache policy audit Lighthouse considers a resource cacheable if all the following conditions are met :

  • The resource is a font, image, media file, script, or stylesheet.
  • The resource has a 200, 203, or 206 HTTP status code.
  • The resource doesn’t have an explicit no-cache policy.

When a page fails the audit, Lighthouse lists the results in a table with three columns :

URL The location of the cacheable resource
Cache TTL The current cache duration of the resource
Size An estimate of the data your users would save if the flagged resource had been cached

See the Lighthouse performance scoring post to learn how your page ‘s overall operation seduce is calculated .

How to cache static resources using HTTP caching #

Configure your waiter to return the Cache-Control HTTP response header :

Cache -Control : max -age = 31536000 

Read more: Google drive

The max-age directing tells the browser how long it should cache the resource in seconds. This example sets the duration to 31536000, which corresponds to 1 year : 60 seconds × 60 minutes × 24 hours × 365 days = 31536000 seconds. When potential, cache immutable static assets for a retentive time, such as a year or longer. One risk of retentive hoard durations is that your users wo n’t see updates to static files. You can avoid this issue by configuring your build creature to embed a hashish in your electrostatic asset filenames so that each version is alone, prompting the browser to fetch the new version from the server. ( To learn how to embed hashes using webpack, see webpack ‘s Caching usher. ) Use no-cache if the resource changes and freshness matters, but you still want to get some of the speed benefits of caching. The browser still caches a resource that ‘s set to no-cache but checks with the server first to make certain that the resource is hush current. A longer hoard duration is n’t constantly better. ultimately, it ‘s up to you to decide what the optimum hoard duration is for your resources. There are many directives for customizing how the browser caches different resources. Learn more about caching resources in The HTTP cache : your beginning tune of department of defense usher and Configuring HTTP caching behavior codelab. To see which resources the browser is getting from its cache, open the Network tab key in Chrome DevTools :

  1. Press `Control+Shift+J` (or `Command+Option+J` on Mac) to open DevTools.
  2. Click the Network tab.

The Size column in Chrome DevTools can help you verify that a resource has been cached :The Size column. Chrome serves the most request resources from the memory hoard, which is very fast, but is cleared when the browser is closed. To verify a resource ‘s Cache-Control header is set as expected, check its HTTP header data :

  1. Click the URL of the request, under the Name column of the Requests table.
  2. Click the Headers tab.

Inspecting the Cache-Control header via the Headers tabInspecting the Cache-Control header via the Headers tab. Set the Browser and proxy cache maximum age in the Administration > Configuration > Development foliate. See Drupal performance resources. See Cache.

Read more: Level up learning in 2022 with Kahoot! | Kahoot!

See Browser Caching. last update : october 4, 2019Improve article

beginning : https://flickroom.net
Category : Web Browsers

Related Posts

Conversion of Prefix to Postfix expression – Flickroom

Google Issues Warning For 2 Billion Chrome Users

Conversion of Prefix to Postfix expression – Flickroom

Hidden Google: 10 Fun Search Tricks

Conversion of Prefix to Postfix expression – Flickroom

Here are the best new Safari extensions to download for iOS 15 and iPadOS 15 (Updated)

Conversion of Prefix to Postfix expression – Flickroom

How to Download Apple Safari on Computer and PC?

Conversion of Prefix to Postfix expression – Flickroom

Internet Download Manager for Chrome Extension 2022 (IDM)

Conversion of Prefix to Postfix expression – Flickroom

Google’s Help Documents Aren’t Always Up To Date

No Result
View All Result
Flickroom

Knowledge of science, technology and life

Follow Us

NEWS

  • Niobi
  • 2 Verified Hotel Reviews of Savis Hotel | https://flickroom.net
  • What is the WordPress .htaccess File?
  • How to install VPSSIM – A lightweight but simple control panel right on SSH
No Result
View All Result
  • Home

© 2021 Flickroom.net