Various caching types and how to use them with your BlaqPanel-hosted site. We cover only the main 3 in this guide. We don’t talk about other cache forms like “browser cache”, “OPCODE cache”, etc…because they don’t make as much impact, not much to explain, and usually already implemented in your cache plugins.
1. Page caching (aka “server caching” or “static caching”)
Most people talking about caching are referring to this one. Page caching means server pre-generated pages to visitors so they don’t have to wait for your server to dynamically process them on the spot. It’s like pre-cooking pizzas beforehand and then handling them over immediately when ordered by customers. It’s faster because they don’t wait!
- To enable caching for your website on our servers, simply use a caching plugin.
- WP Performance, Swift, LiteSpeed Cache are our chosen favorites. (WP Rocket, FlyingPress, and some others are also good.) We’ll release a doc later on which plugins are recommended for which situations and our recommendations for configuring them.
2. Object caching via Memcache or Redis
Object caching is done through a server service, either Memcache or Redis.
- You can have both object caching services running on the server but each site can only utilize one at a time.
- To make it simple, you should use Redis by default. It’s newer, has more features (that WordPress mostly doesn’t use), but also less likely to cause issues.
- Memcache might be slightly faster than Redis in some cases but when it has problems, it’s more problematic than Redis.
- You should also know that object caching isn’t always faster than without. MOST SITES DO NOT NEED OBJECT CACHING. Do not blindly turn it on without testing carefully.
- To enable object caching, first make sure the services are running on the server (from your Server settings > Services TAB), then enable “object caching” feature from your cache plugin. (Not all cache plugins have object caching capability. LiteSpeed Cache does.) Also…you should keep in mind of the interval. It might be set anywhere from 360 seconds to 3600 seconds…obviously, object caching is only intended for high traffic sites. Of course, you can use it speed up slow admin backends as well but that really shouldn’t be how you fix that problem.
3. Edge caching (aka “CDN”)
Edge-caching has long been done by CDN services that use servers around the world (aka “mirror servers” or point-of-presence “POPs”) to copy your site files and serve them faster to visitors around the world. The logic is simple…instead of having faraway visitors downloading assets slower from your origin server, they can download those assets faster from a nearby CDN server. Only thing left to talk about here is limitations and differences between different CDN services.
- CDN’s vary in performance, price, and consistency throughout different geographical reasons. Some are fast while others are slow (even slower than without CDN). Some are expensive while others are free, and price doesn’t necessarily mean quality! Others are fast for some regions while slow for others (it’s common for some to be slow in Asia/Pacific region).
- Most CDN services only cache static assets. Usually just CSS, JS, images, fonts…maybe media like music and video files (depending on their size and how much you pay) along various other files.
- For static assets…a free Cloudflare CDN proxy service is more than enough. If you want more aggressive CDN service, you can try BunnyCDN which is very cheap and I think noticeably better. Enabling them on your site is easy, simply sign-up for them through their site and then integrate through your cache plugin settings.
- There are also some CDN services which also cache dynamic assets as well. This is considered very new and life-changing. For the sake of simplicity, if you’re going to mess with this and don’t have much experience…you should try QUIC.cloud. It’s built by the same company behind LiteSpeed and integrates perfectly with LiteSpeed Cache which is already compatible with your BlaqPanel server (which runs on OpenLiteSpeed server).
- Last but not least…please know that CDN does not automatically make every site faster. This is because CDN’s take time to process assets, and their asset expiry time might be even faster than your local cache plugin expiry time. Long story short….visitors might still experience faster page load directly from your server than through a proxy/CDN server!