Best ArvanCloud CDN Service Settings for WordPress
Your entire wordpress website’s contents will be saved in ArvanCloud edge servers for 30 minutes by default after activating the ArvanCloud CDN service for your website. It is sometimes necessary, however, for the content of some sections of the website to not be cached, or in another case, cached for more than 30 minutes as they remain static for a long time period.
You can go to the ArvanCloud panel, “Content Distribution Network (CDN)”, and “page rules” to specify which contents of your website are cached and which ones are not.
This article discusses setting rules for wordpress websites.
Defining Page Rules in the ArvanCloud Panel
The most important sections, where information should not be cached, or where they can be saved on ArvanCloud edge servers for longer, are discussed next. Note that addresses specified for different folders are the default paths. If you have changed these default paths, put your specified address in these rules.
Note: The rules that you define in this section are prioritized. So if a rule has a higher priority, enter a higher number in the priority section while defining it to place it on top of the list and investigate it first.
- Wp-admin Folder: Information related to the administrator panel (admin) is saved in this folder, since this information should not be saved on ArvanCloud edge servers. In order to not save this information, go to “page rules”, click “new rule,” and define the following rule. Then, select “off” from the “cache operation level”, as shown in the image:
- Login Folder: This file is used to validate user information while entering wordpress. Therefore, information in this folder contains items that should not be saved on ArvanCloud edge servers. Define the following rule to not save this information:
- Staging Folder: If you have created a clone version of your website for testing and development, there is no need to save this folder's contents on ArvanCloud edge servers. Define the following rule to not save this file's contents:
- WooCommerce Cookies: If your website is a shop and you are using the WooCommerce plug-in, you can use the following rules to prevent cookies from being saved on ArvanCloud edge servers:
- Uploads Folder: Files uploaded to the website that are saved in a folder with the same name (uploads) don’t usually change and stay the same for a very long time. A rule can be defined to save this file’s contents on ArvanCloud edge servers for a longer time. To do this, define the following rule and select 30 days, for example, from “Time Cached Information is Valid”. Note that the longer the time, the better, since the contents of this file stay the same and, therefore, ArvanCloud edge servers visit your wordpress website’s main host server less:
- Content Folder: Language, plug-in and skin files are usually saved in this folder. These contents also rarely change in short time spans. A rule can be defined to save this folder’s contents on ArvanCloud edge servers for longer than the default time. Use the following rule for this purpose:
Note: It’s worth mentioning that cache management plug-ins, such as wp-rocket, are managed by you in wordpress websites, and the ArvanCloud CDN service only displays content that you have cached using these plug-ins.
Setting Browser Cache for Website
Website GTMetrix is a tool for speed testing websites. If you don’t set the browser cache for your website to 30 days, you will not receive a high score for leverage browser caching in GTMetrix. The lowest browser caching time span is 7 days.
Go to the “Content Distribution Network (CDN)” and then specify your desired value for “Time Cached Information is Valid”.
Keep in mind that these settings are applied to all cached content on ArvanCloud edge servers, with the exception of items that you explicitly specified in rules to not cache.
Note: It is better to refer to your website’s GTMetrix analysis results to be informed regarding which files can be cached in ArvanCloud edge servers for a longer period of time. You can also use GTMetrix results to find out which files to set rules for and how.