Take advantage of browser cache for blogger

Take advantage of browser cache (Leverage Browser Caching) Blogging is the ultimate way for website owners to take advantage of available browser caching, and to help reduce website load effectively. The purpose of utilizing the available caching of the user's browser is to save the websites they have previously loaded, or, more broadly, use this to store web content, CSS, Javascrip. The user has previously loaded the site at least once. Later on if that person comes back to this site, the page load speed will be very fast, because everything is already stored in their browser's memory. The back visit of the person is not related to the web server query, and the web server does not respond to queries from this user. This will reduce the maximum load for the web server and save a large bandwidth volume. For Wordpress, we created some .htaccess file and uploaded it to the root directory of the server. But for bloggers how to, this is the most difficult problem. Stay in the article Using Cloudflare to speed up blogs that have previously written have setup instructions to take advantage of browser caching, but provided that the site must have its own domain and that the domain must be pointed back. Blog. In this article will be applied to the blogger platform, even have their own domain name or use the free domain name blogspot.com.
browser cache for blogger
browser cache for blogger

How to make use of browser cache for blogger? 

To take advantage of browser caching we should set content variables for Cache-Control and ETag, so that when someone first visits this website, the webserver will return a response containing
Granted Cache-Control and ETag parameters that we have installed for it. These parameters tell how long the downloaded web site data is stored in the browser cache (how often a week, a month, or a year), and how to recover it after it runs out. Termination. Now do the following:

Log into your blogger, go to the Templates and select Edit HTML. Paste the corresponding commands below into the following tag <head>

Public cache-control:

<meta http-equiv="Cache-control" content="public">

Cache-control content:

<meta http-equiv="Content-Type" CONTENT="text/html; charset=ISO-2022-JP">

Cache-control Javascript:

<meta http-equiv="Content-Script-Type" CONTENT="text/javascript">

Cache-control CSS:

<meta http-equiv="Content-Style-Type" CONTENT="text/css">

After adding the corresponding meta tags, the blogger system will automatically optimize and specify the caching time of the browser.

In addition to the above, paste the following code above the tag </head>

<include  expiration = '8d'  path = '/assets/**.css' />
<include  expiration = '8d'  path = '/assets/**.js' />
<include  expiration = '5d'  path = '/assets/**.gif' />
<include  expiration = '5d'  path = '/assets/**.jpeg' />
<include  expiration = '5d'  path = '/assets/**.jpg' />
<include  expiration = '5d'  path = '/assets/**.png' />

This is a code that specifies how long the image, CSS, and Javascript files should be stored on the user's browser, when the user returns to the site again. Data from web server

0 nhận xét