Menu

How to Configure Page Cache in Super Speed module

Page cache is a vital tool for significantly improving website speed by storing all static content as HTML files. These HTML files are then instantly served to website visitors whenever they query a page. To optimize the page cache feature, you can adjust various settings:

  • From the module configuration page, navigate to “Cache and Minification> Page Cache > Page Cache Settings” page.
  • Enable the “Page cache” switch to activate this feature.

 

Select pages to cache

Use the “Pages to Cache” list in Super Speed to select which web pages should be cached. After selecting the pages, you can customize the cache lifetime for each one, ensuring optimal performance tailored to your website's needs.

Here is our suggestion for setting up cache lifetime:

Type of pageCache lifetime (*)Explanation
Home page1 dayThis is the default cache time of many website platforms. It is suitable for websites with average traffic and homepage content that changes frequently.
Category page7 daysCategory pages usually change less often than the home page but still need regular updates to display the latest information.
Product page15 daysProduct pages typically don't change frequently, so a longer cache time will reduce server load.
CMS page30 daysCMS pages require fewer changes and updates compared to main pages, so a longer cache time is suitable.
New products page7 daysThis is a good choice for websites that rarely update new products and have average traffic. If you regularly update new products, you should set a short cache time to ensure users always see the newest products. On the other hand, if you rarely update new products, you can set a longer cache time.
Best-seller page7 daysThis page changes infrequently and doesn't require frequent updates, so a longer cache time is suitable.
Supplier page30 daysSupplier pages change less often, so a longer cache time is appropriate.
Manufacturer page30 daysSimilar to supplier pages, manufacturer pages also change infrequently, so a longer cache time is suitable.
Contact page30 daysThe contact page changes infrequently and doesn't require regular updates, so a longer cache time is suitable.
Prices-drop page1 dayThis is a good choice for websites that rarely change product prices and have average traffic. If product prices change frequently, for example, due to short-term promotions, you should set a short cache period to ensure users always see the latest prices. On the contrary, if the product price changes little, you can set a longer cache period.
Sitemap page7 daysThis is a good option for websites with less frequently changing content and medium traffic. If your website content changes regularly, such as you often add or delete products, articles, etc., you should set a shorter cache time to ensure that the sitemap always reflects the latest content of your website. If your website content changes infrequently, you can set a longer cache time.

  

(*) NOTE

When you set the cache lifetime, cache files automatically expire after the designated period and are regenerated. For instance, the cache for the homepage refreshes every day, while the cache for product detail pages refreshes every 15 days. However, the Super Speed module also provides options that allow for more flexible cache clearing, even before the cache lifetime has expired. This ensures that customers always view the most updated content.

The following options will automatically clear page cache:

  • Automatically delete page cache when changing performance configuration”: Automatically clear the cache when you change performance settings at "Advanced Parameters > Performance > Template Compilation".
  • Automatically delete page cache when installing/uninstalling hook”: Clears the cache when you install or uninstall a hook.
  • Automatically delete page cache when editing page data”:

When you edit product content in the back office and save the changes, the Super Speed module automatically clears the cache for that specific product. This means you don’t have to wait for the cache lifetime of the product detail page to expire.

For example, if you have products A, B, and C with a product page cache lifetime set to 5 days, and you edit product A, the cache for product A will be cleared immediately upon saving. Products B and C will still follow the 5-day cache lifetime unless edited.

If you activate the “Automatically delete page cache when editing page data” option, it will also clear the cache of other pages related to the product you edited, such as category pages, best-selling product pages, etc.

  • Automatically delete page cache when adding or deleting a product from cart”: This option updates product quantities on all relevant pages when a user buys or removes a product from their cart. However, using this option can frequently clear the page cache, which may not maximize the effectiveness of the caching mechanism. Think carefully before turning it on. If the product quantity is not necessary for your site, we recommend keeping it off.

Activating these options ensures customers always see the latest content, but it can also increase server resource usage. Consider carefully which options should be enabled to maintain a balance between performance and server resource consumption.

 

Set up cronjob to delete page cache

When a cache file expires according to its set duration, if a user visits that page then a new cache file will be created and the expired cache file will be deleted at the same time.

If no new users visit that page, the expired file won't automatically delete itself. To manage this, you should set up a cronjob to clear these unused files and free up server space. If a user accesses a page with no existing cache because the old file was cleared and not yet replaced, a new cache file is generated at that visit.

To learn how to set up a cronjob for the Super Speed module, please refer to the following guide: [How To Set Up Cronjob To Automatically Clear Cache]

Tổng lượt xem: 188 lượt xem