OkayCMS Caching Setup
OkayCMS caching setup
A platform specific: the core has no cache layer. This is not a checkbox in the admin — every page is assembled from database queries each time. While there are a few hundred products that goes unnoticed; at tens of thousands it becomes the main constraint.
What can be done
- Web server level caching — a finished page is served without touching PHP or the database. The biggest effect for anonymous visitors and crawlers;
- object caching through an external solution, where the project structure allows;
- image caching: thumbnails generated once rather than on every request;
- browser caching for static assets through correct headers;
- invalidation rules — so a shopper does not see an old price after you change it.
The main trap
Page caching cannot be switched on blindly. The cart, account area and checkout must stay outside the cache — otherwise shoppers start seeing each other's carts. So configuration always comes with a list of exclusions and a verification pass.
The most noticeable win
Usually image caching. The classic situation: the site becomes slow at moments when there are few visitors — because a search crawler arrived and made the server generate hundreds of thumbnails at once.
Tags: okaycms, cache, redis, nginx, performance