Development tool

The development tool will help you throughout the tutorial to obtain information that is ordinarily inaccessible on your site. Before you begin, you must first go to your site and open the development tool. In Google Chrome, you have to press the "Ctrl + Shift + i" key on your keyboard or click on the 3 points on the top right, go to the "More tools" category and click on "Development tools".

Once open, go to the "Network" tab and place a check mark in the "Disable cache" box. This box will prevent the browser from keeping a copy of the page locally, which would distort the analysis.

Cookies

Cookies are ubiquitous when browsing the web. This is text-based information saved in your browser to help identify yourself on various occasions while browsing the web. They have a life span that can range from minutes to months. One of the examples of their uses is to identify a connected user.

Taking into account that it is the cookies who keeps the active authentication, if the user loses his cookies , he will be automatically disconnected. Hence the importance of not putting in the cache all that is on your site. A page with an important cookies in the cache could cause session sharing between different users, so one person might see another's shopping cart. It might also be likely that a user can no longer connect, by placing an empty cookie in the cache, the website will always believe that a visitor has never entered their login information.

Cookies verification on the site

Now that you have a better idea of ​​the use of cookies on the web, let's look at the cookies your site uses. Go to the home page of your site and open the development tool. Make sure you are in the "network" tab and that the sub-tab is set to "Doc". In the majority of cases, there should be only one line. In cases where several lines would appear, I advise you to choose the line that bears the name of the page where you are currently.

When you click on the line, a page should appear on the right. On this page, go to the "Cookies" tab. You will find a list of cookies currently used by your site. Take notes and rank them in the "basic" category. This is a type of cookie that is always present in your site and should not cause any problem with caching the page. After this, browse to a pages that you think would require the addition of new cookies, such as a shopping cart, a login page, a web form, etc. Note these new cookies in the "important" category, since the pages containing these cookies must not be cached in order to guarantee the proper functioning of the site.

The cookies collected at this stage should be placed in the cookies list not to be placed in the Nginx cache (in the Advanced parameter of the cPanel Website Accelerator).

URIs

Now that you have the cookies of your site sorted out, we need to lookout for important URIs. These are the links on your website that represent pages. When talking about adding cache on a site, there are surely some pages where it is better not to cache anything. Among these pages, here are some examples where it is better to refrain from adding caching: an administration area, a form, a member area, and so on. To note the address of the page, you just need to go there and look after the slash of the domain name. If I take a built site with WordPress, the administration page with the domain will be "mysite.com/wp-login.php". The page not to hide will be "/wp-login.php". However, it will be up to you to judge the utility of not caching a page.

Collected pages should be added to the URI list not to be placed in the Nginx cache (in the advanced cPanel Website Accelerator setting).

Note: It is necessary to place part only the following domain, for example for the page "https://example.com/wp-login.php", only kept "/wp-login.php".

Sidebar