Develop an LSCache Plugin
Bring LiteSpeed’s intelligent caching to your own favorite web app!
Why Does Your Web App Need an LSCache Plugin?
If your web app is running on a LiteSpeed server, you could simply add a few rewrite rules to .htaccess and have the app-generated content cached according to those rules. It would work, but it wouldn’t be very sophisticated.
The advantage of a plugin is its ability to bridge the gap between web app and cache engine. A plugin is privvy to the inner workings of the web app. It knows what content is cacheable, when it should be cached, and when it should be purged. With a plugin, you can take important cues from the web app and communicate Cache or Purge directives to the LSCache engine.
A plugin understand the web app’s rules, which is important if you want the app’s pages to be fully and accurately cached.
How Can You Build a Plugin?
LiteSpeed’s LSCache engine is controlled via rewrite rules and HTTP headers.
Your plugin should be able to update .htaccess and send relevant Cache or Purge HTTP headers to the LSCache engine when specific events are triggered within the web app.
It’s as simple as that.
Our LSCache Developer’s Guide will take you step-by-step through the process of creating your own plugin for LSCache, as well as get you familiar with the concepts you need to know. It will provide examples for basic and advanced caching scenarios.
When your plugin is finished, let us know! We’d love to add it to our list of available LSCache extensions.
1
Add Response Headers
instruct LSCache how to tag things
2
Add Rewrite Rules
instruct LSCache how to look up cache entries
3
You're Done
you've got LSCache working