Getting to Know the Parameters for proper caching the Files on Website - ArvanCloud

ArvanCloud Blog

Read more about ArvanCloud news,
updates, products and services in ArvanCloud weblog.

Getting to Know the Parameters for proper caching the Files on Website

7 Aug 2019

It is possible that after migrating your website on ArvanCloud CDN, your website performance could be still slow. In this case, your website or CDN panel will require a new setting. We will guide you step by step to do the required settings in this article.

First you need to make sure that your website is using ArvanCloud’s services. To do this, open your browser in the inspect element > Network. By checking the Response header in your files you can make sure that your website is using ArvanCloud’s services.

You can do this by using the following command:

curl —head http://YOURSITENAME.TLD

If your website doesn’t use ArvanCloud’s services, you need to double check your DNS and NS settings in ArvanCloud panel.

After making sure that your website is using ArvanCloud services, you can check your website’s load. To do this go to the same section : Network > Inspect

Your website’s Load speed is indicated with a red color in this example.

If you’re using ArvanCloud CDN but the load speed on your website’s pages aren’t high, you need to consider the following issues:

1- Header Time Value

2- ar-cache and ar-tim

3- Timing including TTFB and Content Download.

4- Different between the user’s first and second request s regarding the CDN structure

5- Rule setting of your pages in ArvanCloud panel to HIT more requests.

Recommendation before starting the review

It is recommended that before reviewing your website, adjust the settings for Add Custom Header in your Chrome browser:

Adding “ar-cahe” and time to the Network settings of your Chrome browser:

Like in the photo, right click on Network, and on the menu bar and select Response Header > Manager Header Columns.

Then click on the Add Custom Header and enter the ar-cache value.

With these settings, your Chrome browser will link like this:

We will review the settings which mentioned earlier here:

1- Header Time Value

2- ar-cache and ar-tim

3- Timing including TTFB and Content Download.

4- Different between the user’s first and second request s regarding the CDN structure

5- Rule setting of your pages in ArvanCloud panel to HIT more requests.

First you need to go to Network and sort your files based on time, in order to see the requests with the maximum loading time. After sorting the requests, review the ar-cache and TTFB and Content Download parameters.

If the most load time of your page does not have ar-cache, it means this content is being called from outside of your website, hence ArvanCloud headers are not on it. To solve this issue you need to review these links or remove them from your website.

If the highest load time of the page is related to pleas with a MISS ar-chace, It means this page is being returned directly to the user and not cached in ArvanCloud. To solve this you can define the rules in “Page rules” and cache it, or if it is not possible to cache that page, you need to solve the issue by checking out your server speed.

If you have a page with a HIT ar-cache but the load of that page is high, open that request separately and review the ar-cache time. If the request loads with a high speed but it’s slow on your website, it means it is pending on your website due to other requests and until the time of this request, a long time has passed. To solve this issue, implement changes that don’t pend the requests to be called in your website.

A Few other Points that Help you Review the Settings

  • When the ar-cache value is HIT, it is open separately, but the time is high, you need to review the Content Download in Waterfall and Timing sections. If the size of your file is big or your internet speed is low, the content download means the time  that your internet has taken to download the file, and this has nothing to do with the server speed or to ArvanCloud.
  • When you open the sire, the first request of a MISS while there is no rule defined for caching in the page rules:

This issue overs when the first user’s request connects from each ArvanCloud Pop-site to your origin server and then it’s cached in the opposite. Consequently, in the next request, the Cached file will be responded from ArvanCloud servers to the user.

دیدگاه شما