Ga direct naar de hoofdinhoud van deze pagina.

Website cache setup

What is the website cache?

Not to be confused with browser cache, or client cache, for more info on that see: https://www.refreshyourcache.com

If a visitor opens a page on the website, the page will be build on the webserver, which means all content of the page is combined into one single page. When this building is done, the webserver sends the page to the visitor. This building takes for example 0.5 seconds. After the webserver is ready with building the page, the page is not only sent to the visitor, but also stored in the website cache. In this way the website cache contains a copy of the full page of the website, on the webserver. Whenever any (other) visitor will request this page again, the webserver does not need to build the page again because it was already ready, and just sends the cached page to the visitor. The page is now visible to the visitor 0.5 seconds faster.

Of course a problem arises if the page has changed in the meantime, for example if some text was added. In that case the old version (from cache) will be shown to the visitor. This is good as long as we are working on changing the content of the page, but when the new content is done, we want the visitors to see the new content. To make sure visitor see all the new content, we should clear the server cache after we are done editing website content. This can be done manually with a "publish" button, or automatically based on the website settings in the CMS, for example automatic clear after 1 hour or 1 day.

As a side note; if we would open the page from the CMS with the button "show page", we will always see the new page. In this case the cache will not be used.

Why do we use server cache?

Server cache is used for improving the speed of the website. The more visitors we have, the bigger the advantage of the server cache. If we could save 0.5 seconds of server time on every page view, we not only show the page faster to the visitor, but we also allow the server to focus on other things, like sending other pieces of code or data to the visitor. This improves the experience the visitor has on the website. As an added bonus, also Google likes faster pages, so your website will score better in search engines.

How to set it up?

In the CMS we go to the module settings and go to tab "website configuration". We find the setting with the name "pagecache" and enter the number of seconds it takes to automatically delete the cache of every page. Use for example "84600", which is 24 hours, or "3600" seconds which is 1 hour.

From version 4.2.66 this setting is also available under the "basic website configuration" tab in the module settings in the CMS.