Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
25 Million+
Websites using our plugins
Years of WordPress experience
WordPress tutorials
by experts

What is: Page Cache

Editorial Note: We earn a commission from partner links on WPBeginner. Commissions do not affect our editors' opinions or evaluations. Learn more about Editorial Process.

In WordPress, a page cache stores a complete snapshot of your website’s pages, including its text, images, and code. This is often referred to simply as the WordPress cache and is one of the best ways to speed up your website.

The first time a WordPress web page is visited, it needs to be built by running scripts, reading data from a database, and more. This takes time.

A page cache saves this HTML version of the web page for future visitors. Because the page doesn’t need to be built from scratch again, it loads 2-5 times faster.

Glossary: Page Cache

How Are WordPress Pages Normally Loaded?

WordPress stores your website content in a database. It includes your posts, pages, comments, categories, tags, custom fields, users, and other WordPress settings.

You may remember that when you installed WordPress, you were asked to provide a database name, host, username, and password.

WordPress uses the MySQL database management system, and it runs as an application on your web server. This uses some of the server’s resources whenever someone visits your site.

Before a visitor can view a web page on your WordPress website, some scripts run that load the content from your database and create an HTML web page that the user’s browser can display.

When a lot of visitors visit your WordPress website at the same time, there will be a lot of requests to your database and your site will load slower.

For more detailed information and an infographic, see our guide on how WordPress actually works behind the scenes.

How Does a Page Cache Improve Page Loading Speed?

The first time someone visits a certain page, it is built dynamically from the database as we described above. The difference is that the HTML page that was generated is saved in a cache, which is a temporary storage space.

The next time someone visits the page, the pre-built HTML version will be loaded from the cache.

How a WordPress Cache Works

Because the page doesn’t need to be dynamically generated from the database, there will be less load on your web server, and the page will load faster.

It might be helpful to think of a sandwich shop because they use a similar strategy to cope during busy periods. They make their most popular sandwiches in advance so they are ready to go during the lunch rush. This allows them to serve many of their customers more quickly.

How Do You Add a Page Cache to Your WordPress Website?

Many reputable WordPress hosting companies like Bluehost and SiteGround offer built-in caching solutions. The cache is turned on by default, and you can configure it from your hosting provider’s dashboard or by using a plugin.

If you use a hosting company that doesn’t have built-in caching, then you can easily add a cache to your website using a good WordPress caching plugin like WP Rocket.

Won’t Cached Pages Become Out of Date as Your Website Is Updated?

You might be concerned that your cached web pages will become outdated as you update your website. That is a potential danger.

This is handled by setting an expiration date for cached pages. Once a cached plugin is out-of-date, it will be rebuilt automatically from the database the next time someone visits it.

Setting a Cache Expiration Date in WP Rocket

If your website content changes often, then it is best to set a shorter expiry date. For websites with few changes, you can set a longer expiry date.

You can also manually clear your WordPress cache to make sure that your visitors are seeing your latest updates. You can learn how to do this for several popular caching plugins and hosting providers in our guide on how to clear your cache in WordPress.

Clearing the WordPress Cache in WP Rocket

What Other Types of Cache Are There?

A page cache isn’t the only type of cache that can speed up your online experience.

Here are some other cache types:

  • A browser cache temporarily stores web page resources like images on the user’s computer. These won’t need to be downloaded again the next time the user visits that page, reducing load time.
  • A DNS cache stores the IP address of visited websites on the user’s computer. The next time the user visits that website, the browser won’t need to look up the IP address from an online DNS server, saving time.

For more information about different types of caching, you can see our Cache glossary entry.

We hope this article helped you learn more about page caches in WordPress. You may also want to see our Additional Reading list below for related articles on useful WordPress tips, tricks, and ideas.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Additional Reading

Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit - a collection of WordPress related products and resources that every professional should have!