Develop Your Own LSCache Plugin
Bring LiteSpeed’s intelligent caching to your favorite web app!
Why LSCache Plugins Are Essential for Your Web App
If your web app runs on a LiteSpeed server, you can add a few rewrite rules to .htaccess to cache app-generated content. While this works, it’s a basic approach and lacks advanced caching features.
The advantage of a plugin lies in its ability to bridge the gap between your web app and the cache engine. A plugin understands the inner workings of your app, knows which content is cacheable, when it should be stored, and when it should be purged. With a plugin, your web app can provide key cues, sending precise Cache or Purge instructions to the LSCache engine.
A plugin understands your web app’s rules, ensuring that pages are fully and accurately cached.
How to Develop a Plugin for LSCache
LiteSpeed’s LSCache engine is managed through rewrite rules and HTTP headers.
Your plugin should update the .htaccess file and send appropriate Cache or Purge HTTP headers to the LSCache engine whenever specific events occur within the web app.
It’s really that simple.
Our LSCache Developer’s Guide walks you step-by-step through creating your own LSCache plugin while introducing essential caching concepts. It includes examples for both basic and advanced caching scenarios.
Once your plugin is complete, let us know! We’d love to feature it in our list of available LSCache extensions.
1
Add Response Headers
Instruct LSCache on proper content tagging
2
Add Rewrite Rules
Instruct LSCache on cache entry lookup
3
You’re Done
Your LSCache is active and working