Advanced page cache module is a useful server-side module to save dynamic web pages to static HTML pages and send the static html pages to users, by doing so to greatly improve server-side speed. The more modules you’ve installed, the more time will be saved. Why you need to use this cache module? Generally this module could increase server side loading time for 5+ times.
In order to have a better understanding of this module usages, let us take a look at what makes up Page loading time first.
What makes up Page loading time.
The page loading time is made up of two big parts:
- Server side loading time.
- Front end loading time.
The server-side performance is the same important as the front end performance, your page will be extremely fast when you optimize both of them.
For most PrestaShop site owners, we just need to do improvements which are easy and budget-friendly, absolutely no needs to a pursue 100 scores, that’s for ultimate advanced users. For example:
- Doing all basic improvements requires $50 and 10 hours, the result is that the total page loading time get reduced for 2 seconds.
- Doing other high level improvements requires $500 and 50 hours, the result is that the total page loading time get reduced for another 1 second.
Then doing all basic improvements is enough for most PrestaShop site owners.
Major components affect total page loading time
- Server side loading time.
- Computer performance.
- Browser performance.
- The number of requests.
- The total size of images*
- The total size of Js/css files
- The total size of Font files
- Front end loading time.
- Server performance.
- Server configuration.
- Location of server.
- Code quality.
- The number of modules.
Reducible time and Irreducible time
Please refer to How to speed up PrestaShop site – Optimized front end to know more about front end loading time. We will talk about Server side loading time here.
Server side loading time is made up of these components.
- Server performance.
- Server configuration.
- Location of server.
- Code quality.
- Config modules properly .
You can do as much you can to optimized them. Let’s talk about them one by one.
1. Server performance.
The result of a more powerful server is more short server side loading time.
You can about 3 options:
- Shared hosting: Affordable, Not fast, limited server resources. A shared hosting doesn’t mean it’s a bad hosting, most websites are running on shared hosting, the best choice for small business.
- Dedicated hosting: Expensive, fast, nice performance. This is for sites which have a lot traffics.
- Cloud hosting: Fast, high delivery speed. We recommend Cloudways.
You don’t need to struggle on this point, it’s all about budget.
2. Server configuration.
This is for advanced users, to properly configuration a server is a task requires a lot knowledge and skills. Let start from simple and doable solutions to advanced ones.
- Gzip. All major hosting have Gzip installed by default, you can use tools like Gtmetrix, PageSpeed and YSlow can be used to check, if Gzip isn’t installed you can contact your hosting company to installed it or just move to a better hosting company.
- PHP version. PHP7 is way faster than PHP5, that’s for sure, so upgrade your php version if it’s possible, you can contact your hosting company for help. But we don’t recommend to the very latest version, for example nowadays PHP7.2.x is relatively new, we recommend to upgrade to PHP 7.1.x, because of prestashop themes and modules need time to be updated for the latest version of PHP.
- Using Memcache cache or OpCache or other similar cache systems, this is for advanced users, to set up a 100% working cache system on PrestaShop is not easy, but it’s still worthy for large business, because server side cache systems store data in the server’s RAM memory, getting data from RAM memory is the super fast getting data from hard drivers, that’s why using a server side cache system can reduce server side loading time. You can hire someone or using a module to help you. But some new techs, like SSD drive, have already dramatically improved the speed of query data from drivers, so for small business, it’s not that necessary to use a server side cache system, choosing a fast hosting is enough.
- Force browser to cache pages. This can be done by using a module, we currently don’t add the feature to this advanced page cache module, cause it has its pros and cons.
- Optimize database, this is for advanced users.
- Microsoft IIS. Don’t run your site on IIS. Apache 2.x or Nginx are the best.
3. Location of server.
Locate your hosting to as close as possible to your target customers.
4. Code quality.
5. Other solutions to speed server side loading time.
Uninstall modules you don’t need.
You can find a list of PrestaShop 1.7’s native modules which we recommend you to disable Disable these native PrestaShop 1.7’s module. For Transformer theme and Panda theme users, you can also disable those ones you do not need, here are a list of modules you can not disable.
- Theme editor
- Overriding default behaviors
- If you use blog, then “Blog module” and “Blog editor” are also can not be disabled.
6. Config modules properly.
- Revolution Slider Module. This module will be hooked to a lot of hooks by default, which would slow your site down, if you just use the module to display a slider on the homepage, then remove the module form all other hook, except these ones: displayHeader, displayBackOfficeHeader, displayRevSlider and actionShopDataDuplication.
How this advanced cache module works.
All pages of a PrestaShop site are dynamic pages. Here are brief processes, which will be run, When you visit a dynamic page.
- PrestaShop runs and queries data from database.
- PrestaShop calls modules to run.
- Both PrestaShop and modules fetch data to template files
- Sends content back to you.
Without using a page cache module
The advanced page cache module avoids PrestaShop to query data and fetch template files for every user again and again, by doing so to reduce server side loading time a lot.
With this advanced page cache module
I once saw a vivid metaphor, it says that
Sending your users “cached” pages is like giving them photocopies of a flyer, that’s way much faster than redrawing the content for every user.
Loading cached pages is the best way to reduce server side loading time, because the server can just send back cache static html pages, no need to query data and fetch template files. For example the server side loading time is 1.5 seconds without using this page cache module, the time can be reduced to about 0.5 seconds when this advanced page cache module is installed. You may ask why not 0, because some data can’t be cache and some essential things must be done every time.
How long the page loading time can be reduced by this module.
There are two ways to know that.
- Check the statistic board tab on this module. This is the accuracy way, because beside server cup usage and memory usage, no other factors affect the result.
- Use the Google page insights to check. On the result of Google page insights, look for TTFB(Time To First Byte), although network condition affects TTFB, TTFB is still good indicator of how long your server takes to send a response back, , the shorter TTFB the better. To know more about TTFB, please check this article posted by Google Keep Server Response Times Low. With this module TTFB will be reduced a lot.
You may ask “Can I use Google page insights, GTmetrix, Pingdom and YSlow to check how long the page loading time has been reduced?” Those tools are basically for the front end performance, the server side performance only takes a small portion of the result, so those tools can’t show clearly how much the server side performance has been improved, if you do a lot of tests on them.
Here are data I got on PrestaShop 22.214.171.124 + Transformer theme
Why they are different? because they are two different types of data, but they can all show the server side loading time has been improved. Don’t look down on those not big differences, you will be benefited in a long run.
- Faster loading speed. Your site will be immediately faster after using this module.
- Increase sales. Increasing the page loading speed to get more friendly user experience, you will get more orders with a fast page loading speed.
- Improve SEO rank. The server side response time is a major factor for SEO rank, the shorter the better, check this official documentation about improving server side response time.
- Reduce bounce rate. The faster your pages load, the lower your bounce rate will be.
- Save hosting resources. This cache module can decrease the usage of CPU and RAM, that’s always a good thing, no matter you are on a Shared hosting or a Dedicate hosting.
Three ways to refresh cache.
- Automatically update cache: The cache will be automatically updated when it’s expired.
- Automatically refresh cache: If you make some important changes which may affect the front end, then the cache will be refreshed automatically.
- Manually refresh: You can manually clear the cache at any time.
Ability to cache for different devices and different customer groups.
- Cache for different devices: an option to cache pages for mobile and desktop separately.
- Cache for different customer groups: If you offer different discounts or views for different customer groups, this option is very useful.
Two ways to store cache.
- File system
This module can compress cache files to save your disk volume when use file system to store cache.
Which one should I use?
- Using File system to store cache files is the default way, this way is stable, it’s able to store a large amount of cache files.
- Using Database to store cache files is faster, but it can’t handle a large amount of cache. If you ask how much is a large amount, that depends on the size of content on your pages, generally I guess if you need to cache more than 10000 pages, then that can be considered as a large amount.
Ability to cache pages created by 3rd party modules.
This module is flexibility, it not only is able to cache PrestaShop’s native pages, but also is able to cache page created by 3rd party modules. Ability to cache pages created by 3rd party modules, like blog modules, faq modules, review modules, etc.
You can see how much time this module saves on a statistic board where you can see these data.
- Which pages have been cached.
- How many times a cached page has been viewed.
- How many times a cached page has been refreshed.
- How long is the server side load time for every cached page.
- How long is the server side load time for pages which have not been cached.
It’s also be able to use a small window on the front office to show detailed information of how this cache module works. Note, don’t enable the window when your site goes live.
- Compatible with PrestaShop 1.7 and PrestaShop 1.6.
- Compatible with almost all themes.
- Compatible with debug mode. Ability to enable the cache when in debug mode.
- Compatible with most 3rd party modules: This module is compatible with most 3rd modules without any code changes.
- Compatible with multi store feature: This module is compatible with PestaShop multi store feature, you can enable the cache for one or all stores under the multistore. Note you need to buy one license of this module for each store.
- Compatible with the front office security feature. You can find the “Increase front office security” setting on the “BO>Shop parameters>General” page, it’s used to improve PrestaShop’s security by adding dynamic token to front office pages. This cache module can handle this well to make sure you can have a fast & security front office.
Ability to don’t use cache for logged users.
For example the cache version of a site’s homepage is the same for every user, but that’s going to work logged users, because of the username or some other information shows on the homepage are be different for different users. Two solutions for this.
- Disable cache for logged users.
- Tick all user info related modules as dynamic modules on the “DYNAMIC MODULES” tab. For example, the “Customer Sign in link” module, the Wishlist module.
Not all content need to be cached, for example the viewed product module, it can’t be cached, because of once it’s cached, the module show the same content for all users, that’s wrong. With the dynamic content feature you can set any content of your site to be dynamic, dynamic content won’t be cached.
- Customize cache duration: You can set the cache duration, recommended value is one day.
- You can choose pages you want theme to be cached, such as homepage, the product page, the category page, the CMS page, or any other pages created 3rd modules.
- Manage dependence hook: in some themes(such as Transformer theme or panda theme), there are some hooks must be executed before any other modules loaded, there is a possibility to inject those hooks easily.
- Ignore some extra parameters. Some modules may add extra parameters to urls, because of url is used to identity pages, extra parameters may cause the same page getting cached to for several times, just because of urls are different, this module can solve the problem by ignoring those parameters.
- Cache for restricted countries: This module can cache pages for all restricted countries. You can set on the “Geolocation” page.
- CDN or media server support. This module can work fine when you are using a CDN or a media server.
How to install and upgrade.
This advanced page cache module for PrestaShop can be installed easily without editing any files.
How to install? Use the “Upload a module” button on “BO > Modules” page to install the module.
How to upgrade? >Use the “Upload a module” button on “BO > Modules” page to upload the new version to your site, it’s the same as how to install, don’t worry all your data will be safe, PrestaShop will just upload updated files to your site, it won’t reinstall this module.
How to get support.
If you have any questions with the module, post them out on the prestashop module support forum, we’ll help you out.
For a eCommerce site, not all pages can be cached, some pages are different for every customer.
No need to worry on PrestaShop. Cache files are just text files, they are small, the amount of cache files of a prestashop can’t be very large. Also don’t worry about the server needs a long time to find the correct cached static html page for a requests, because the amount of cache files of a prestashop can’t be a huge number.
They are completely different, they are two things. PrestaShop use Smarty for template files, you can consider the smarty cache as a interpreter who translate Smarty to php, when the smarty cache is disabled, the interpreter need to do translate Smarty to php for every request. The smarty cache is used to reduce the time of “Fetch template files”.
It’s basically the same with the dynamic content feature, the difference is that hooks here will be run before all other hooks. Generally don’t change this setting.