Without caching, every visitor triggers the same work: PHP runs, the database is queried, and a page is assembled from scratch. Caching stores the finished result and serves that instead. For a site whose content changes a few times a week, this is close to free speed.

There are several layers, and they stack:

  • Page caching - the finished HTML is stored and reused. Biggest single win for most sites.
  • Object caching - repeated database results are held in memory.
  • OPcache - compiled PHP is kept ready. On by default on our servers, nothing for you to do.
  • Browser caching - returning visitors reuse images and stylesheets they already have.
  • CDN - static files served from a location near the visitor.

On WordPress, one good caching plugin handles the first, fourth and often the fifth. Install exactly one - two caching plugins running together conflict and usually make the site slower and stranger.

Do not cache pages that should be personal. Carts, checkouts, account pages and login screens must be excluded, or one customer can be shown another customer basket. Any sensible plugin excludes these by default, but check after setup rather than assuming.

And when you change your site and the old version stubbornly persists - clear the cache. That is the answer surprisingly often.

Hjalp dette svar dig? 0 Kunder som kunne bruge dette svar (0 Stem)