Add the expires header to the WordPress site.

Have you seen the suggestion of \
For it to work, the site owner must set the expiration header. This causes the browser to save the resource locally for a specified period of time set by the expiration header. For example, if you set an expiration header in a JPEG file, the browser saves all JPEG files in the cache. This means that the browser caches some resources related to the site, so visitors can load the site faster. Expired headers can improve site speed by reducing HTTP requests between computers and servers (a method for communication between browsers and servers). The browser cache can be used to learn from the browser cache. You can use the cache in the browser to store resources locally, so as to improve the speed of the website. The
How does it work? The browser sends a request to the server when it loads the web site. At the cost, the server will send the required resources. To load the site faster, the browser can use the expiration header to determine which resources can be loaded locally from the browser cache. I’m not sure. What do you mean? Let’s see if browser caching works. Gtmetrix is a website speed and performance optimization site. Displays a detailed report on how to load the site. As you can see, wpastra’s primary site uses browser caching. This is all possible because of expired headers. The
Using expired headers to search the cache can reduce HTTP requests between the computer and the server, thereby reducing site load time. How the expiration header works in the browser cache the browser cache stores resources according to the rules of the expiration header (another name of the expires header). These rules apply to how resources are used when the browser loads the site. Therefore, by default, an asset is loaded from the browser cache if its lifecycle has not expired. Otherwise, the computer will re request from the server. But what happens if the computer requests the site for the first time? The
In this case, all resources in the site will be ed directly from the server. Starting with the second, the browser will check for unexpired resources in the cache and use these resources to save bandwidth and time. If you want to know more about the technology, please refer to the following content. But if you are not interested, you can skip to the next section! As you can see from the image, the browser first checks the resource cache (browser cache). The information is then sent from the server to the browser via HTTP headers. What the HTTP header needs to know is that it is used to send additional information between the computer and the server. The
Another important concept that makes this possible is cache control. Cache control allows you to define browser caching policies that run on the server side and on the client side. Viewing the above image, you will find that the expiration time set on the HTTP header is completed using cache control.
. In short, cache control provides a better way to implement browser caching by overcoming browser based caching. For example, consider the following: The maximum age of wpastra is when the location cache expires to store the resource cache that needs to be cached. See if cache control on COM works. The
If you want to learn more, please check the cache control HTTP guide of Mozilla MDN or read the Google Guide. To learn more about caching and how it relates to WordPress, please see the final guide to WordPress caching posts. The reason why the maturity head is important is that the maturity head is important for the following reasons. Helps to load the site faster (after the first initial request). This helps the server manage more requests at a given time. Which resources need to be cached with the androg expires header? The expires header is useful if you know which resources need to be cached. For general blog sites, rules can be applied to a wide range of resources including images, videos, etc., so it is easy to implement expiration headers. The
However, if you need to implement a complex site, such as e-commerce, problems will arise. In both cases, the goal is to reduce rather than increase HTTP requests. So, what resources should be cached? For a better understanding, let’s look at a few scenarios. Scenario 1: the resource expiration time is too long. If the resource expiration time is too long, the resource will be provided to the user without any change within this time period. In this case, if you decide to change the site within the specified time period, users can still view the previous version of the site before the resource expires. The
Depending on the resource type, you can define and resolve expiration times. Generally, do not add a default time range to all resources. For example, you cannot cache an entire portion of a script, HTML, image, or other resource format. Even if you decide to do so, you should know the impact of the change on the site. \
Scenario 2: if you run an e-commerce site (such as an e-commerce site) with complex functions, please pay attention to the problems caused by the expiration header. The following example. Users visit e-commerce websites to add new items to shopping carts. However, if the resource cache of the site is wrong, the products added by the user in the previous session will be displayed in the shopping cart instead of the newly added products. The buyer can press ctrl+f5 (force cache refresh) to solve the problem, but it may require too much from the buyer. This will also produce a poor user experience and significantly affect user maintenance and sales data. The
So where does this get us out of here? The e-commerce owner can decide to add the expiration header to the resource, depending on the impact on the user experience. Your goal is to provide a smooth user experience without disrupting the site. Don’t worry, even if it seems too complicated and overwhelming. You only need to know that the expired header tells the browser what items to import and what items should not be used in the cache. Your task is to decide what to set and what not to set. Then we discussed it. Please read on. Does the expires header solve the slow website loading time? Not all sites create the same, and the way expired headers work will change. For example, improperly caching e-commerce sites
This will result in errors that directly affect the functionality of the site. The site will also slow down. For other regular sites, title expiration can reduce HTTP requests and improve site load time. In some cases, if the expired header is not implemented correctly, the site may slow down. The method of adding expires header on WordPress website is great. If you do this, you are entitled to cookies! WordPress is a multi-functional content management system. This means you have the flexibility to deal with problems. Therefore, this section will manually add expiration headers to servers such as Apache server, nginx, and CDN systems. It also demonstrates how to add expired titles using the plug-in. (yes, we know it’s mainly you who read it.) One of the easiest ways to manually add the expires header push to the expiration header on the WordPress website running on the Apache server is. Execute through htaccess file. There are two access methods: We will use the first method of the FTP client, such as cPanel FileZilla. If you know how to use FTP to connect to a web server, this method also applies to FTP clients. You must first log in to cPanel. If you are using a popular hosting platform such as BlueHost or inmotion hosting, you must have the following options: Male click it to access cPanel. File manager options can be found there. Male click file manager there, and then click the \

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *