GLOSSARY
PICTOGRAMS DEFINITION
 
GET EXTRA INFO

 
CLICK AND PLAY

Manage the cache
Understand what the cache is and how to refresh pages
All the versions of this article: فارسى | English
Lessons you should have completed:
General overview
Editor level

What will I learn to do?

INSIDE VIEW

As an administrator it is vital that you understand the importance of the cache and the impact it will have on your day-to-day work.
In this tutorial, you will learn:

- What the cache is and why it is useful

- How to refresh an article in the cache when you modify it

- What to do when you make a change that affects all the pages of your site

What is the cache?

When your online magazine pages are viewed by your visitors, a lot of complex processes take place in the background:

Treatment of the request (without the cache)

- PHP makes a request to the database, where the data is stored

- The database executes the request and presents the results back to PHP

- With this data, PHP builds the page which is displayed to the visitor

This process uses a lot of system resources!

 

Treatment of the request with the cache

To avoid this process to take place every time a visitor loads a page, SPIP creates a temporary storage area where previously generated pages of your site are stored for future access: the cache.

DID YOU KNOW?

Why is the cache so important? The cache reduces the burden on system resources, enabling greater throughput and shorter access times.
The more hits your site gets, the more important the cache is.
Let’s make some very simple calculations: fetching a page in SPIP generally requires 50mb of RAM; suppose your server has a capacity of 200mb of RAM - it’s often less on a shared server:
- Without caching, your site would not be able to handle more than 4 concurrent visitor requests
- A cached page requires 0,05mb of RAM: thanks to the cache, your site can handle up to 4,000 concurrent visitor requests!

Still not convinced?

If your site is very popular, the load that your MySQL database is put under may sometimes lead to database outages.
In this case, thanks to the cache, your site continues to function because cached pages are not dependent on the database: the database outage does not disrupt your visitors’ user experience!

The cache provides extra resilience to your journalistic services.

Why must I refresh pages?

DID YOU KNOW?

By default, the SPIP cache is refreshed automatically every 24 hours.

When you create a new article, it is saved in the database; when a visitor sees it online, the page is calculated once and the result is saved in the cache.

It means that the second time a visitor sees the page, the content is not coming from the database but from the cache.

So what happens if, in the meantime, you have changed the article?

The answer is often that the visitors will not see your changes until the cache has expired.

When you manually refresh the article, you empty the cached version of this article, and therefore your visitors can see the latest version.