All-in-one unbeatable acceleration & PageSpeed improvement: caching, image/CSS/JS optimization...
LiteSpeed Cache for WordPress (LSCWP) is an all-in-one site acceleration plugin, featuring an exclusive server-level cache and a collection of optimization features.
LSCWP supports WordPress Multisite and is compatible with most popular plugins, including WooCommerce, bbPress, and Yoast SEO.
LiteSpeed Cache for WordPress is compatible with ClassicPress.
General Features may be used by anyone with any web server (LiteSpeed, Apache, NGINX, etc.).
LiteSpeed Exclusive Features require one of the following: OpenLiteSpeed, commercial LiteSpeed products, LiteSpeed-powered hosting, or QUIC.cloud CDN. Why?
+ This service is not provided by the LSCache plugin, nor is it guaranteed to be installed by your service provider. However, the plugin is compatible with the service if it is in use on your site.
* Feature not available in OpenLiteSpeed
The vast majority of plugins and themes are compatible with LSCache. Our API is available for those that are not. Use the API to customize smart purging, customize cache rules, create cache varies, and make WP nonce cacheable, among other things.
This plugin includes some suggested text that you can add to your site’s Privacy Policy via the Guide in the WordPress Privacy settings.
For your own information: LiteSpeed Cache for WordPress potentially stores a duplicate copy of every web page on display on your site. The pages are stored locally on the system where LiteSpeed server software is installed and are not transferred to or accessed by LiteSpeed employees in any way, except as necessary in providing routine technical support if you request it. All cache files are temporary, and may easily be purged before their natural expiration, if necessary, via a Purge All command. It is up to individual site administrators to come up with their own cache expiration rules.
In addition to caching, our WordPress plugin has online features provided by QUIC.cloud for Image Optimization, CSS Optimization and Low Quality Image Placeholder services. When one of those optimizations are requested, data is transmitted to a remote QUIC.cloud server, processed, and then transmitted back for use on your site. Now if using the QUIC.cloud CDN it uses LSCache technologies to access your site then host your site to others globally and also your data is not transferred to or accessed by QUIC.cloud employees in any way, except as necessary in providing maintenance or technical support. QUIC.cloud keeps copies of that data for up to 7 days and then permanently deletes them. Similarly, the WordPress plugin has a Reporting feature whereby a site owner can transmit an environment report to LiteSpeed so that we may better provide technical support. None of these features collects any visitor data. Only server and site data are involved.
Please see the QUIC.cloud Privacy Policy for our complete Privacy/GDPR statement.
ON
.--wordpresspath
parameter.This plugin communicates with your LiteSpeed Web Server and its built-in page cache (LSCache) to deliver superior performance to your WordPress site. The pluginβs cache features indicate to the server that a page is cacheable and for how long, or they invalidate particular cached pages using tags.
LSCache is a server-level cache, so it’s faster than PHP-level caches. Compare with other PHP-based caches.
A page cache allows the server to bypass PHP and database queries altogether. LSCache, in particular, because of its close relationship with the server, can remember things about the cache entries that other plugins cannot, and it can analyze dependencies. It can utilize tags to manage the smart purging of the cache, and it can use vary cookies to serve multiple versions of cached content based on things like mobile vs. desktop, geographic location, and currencies. See our Caching 101 blog series.
If all of that sounds complicated, no need to worry. LSCWP works right out of the box with default settings that are appropriate for most sites. See the Beginner’s Guide.
Don’t have a LiteSpeed server? Try our QUIC.cloud CDN service. It allows sites on any server (NGINX and Apache included) to experience the power of LiteSpeed caching! Click here to learn more or to give QUIC.cloud a try.
LSCWP includes additional optimization features, such as Database Optimization, Minification and Combination of CSS and JS files, HTTP/2 Push, CDN Support, Browser Cache, Object Cache, Lazy Load for Images, and Image Optimization! These features do not require the use of a LiteSpeed web server.
Yes, LSCWP will always be free and open source. That said, a LiteSpeed server is required for the cache features, and there are fees associated with some LiteSpeed server editions. Some of the premium online services provided through QUIC.cloud (CDN Service, Image Optimization, Critical CSS, Low-Quality Image Placeholder, etc.) require payment at certain usage levels. You can learn more about what these services cost, and what levels of service are free, on your QUIC.cloud dashboard.
A LiteSpeed solution is required in order to use the LiteSpeed Exclusive features of this plugin. Any one of the following will work:
The General Features may be used with any web server. LiteSpeed is not required.
The cache entries are stored at the LiteSpeed server level. The simplest solution is to use LiteSpeed WebADC, as the cache entries will be stored at that level.
If using another load balancer, the cache entries will only be stored at the backend nodes, not at the load balancer.
The purges will also not be synchronized across the nodes, so this is not recommended.
If a customized solution is required, please contact LiteSpeed Technologies at [email protected]
NOTICE: The rewrite rules created by this plugin must be copied to the Load Balancer.
The actual cached pages are stored and managed by LiteSpeed Servers.
Nothing is stored within the WordPress file structure.
Yes it can work well with OpenLiteSpeed, although some features may not be supported. See Plugin Features above for details. Any setting changes that require modifying the .htaccess
file will require a server restart.
In short, yes. However, for some WooCommerce themes, the cart may not be updated correctly. Please visit our blog for a quick tutorial on how to detect this problem and fix it if necessary.
Images are not optimized automatically unless you set LiteSpeed Cache > Image Optimization > Image Optimization Settings > Auto Request Cron to ON
. You may also optimize your images manually. Learn more.
Our API includes a function that uses ESI to “punch a hole” in a cached page for a nonce. This allows the nonce to be cached separately, regardless of the TTL of the page it is on. Learn more in the API documentation. We also welcome contributions to our predefined list of known third party plugin nonces that users can optionally include via the plugin’s ESI settings.
The crawler is disabled by default, and must be enabled by the server admin first.
Once the crawler is enabled on the server side, navigate to LiteSpeed Cache > Crawler > General Settings and set Crawler to ON
.
For more detailed information about crawler setup, please see the Crawler documentation.
The vast majority of plugins and themes are compatible with LiteSpeed Cache. The most up-to-date compatibility information can be found in our documentation
Str::rrand
.litespeed_optm_uri_exc
to exclude URI from page optimization..well-known
path from page optimization.Presets
feature and menu item.UCSS File Excludes and Inline
to increase page score. (Ankit)defer
attribute from Lazy Load image library usage. (#928019)Create WebP Versions
setting. Will automatically enable when Image WebP Replacement
is activated.LITESPEED_CRAWLER_DISABLE_BLOCKLIST
constant for unexpected results too. (Abe)data:base64
results.data:
image value.WP_CONTENT_URL
protocol if it was explicitly set to http://
.open_basedir
PHP setting limit when detecting load before crawling. (Tom Robak/mmieszalski)queue_k
to API notification.Debug String Excludes
option. (Hanna)Purge this page - UCSS
option to Admin Bar dropdown menu. (Ankit)litespeed_guest_off=1
URL query string parameter to bypass Guest Mode. (cbdfactum)LSCWP_OBJECT_CACHE
predefined to turn off Object Cache. (knutsp)View site before optimization
button under Debug
tab. (Ryan D)DONOTCACHEPAGE
constant to indicated WP-Admin pages are not cacheable.out_of_quota
. (Lauren)LITESPEED_CRAWLER_DISABLE_BLOCKLIST
and filter litespeed_crawler_disable_blocklist
to disable blocklist. (Tobolo)CDN URL
and Original URLs
if user didn’t provide one. (Lucas)WebP Attribute to Replace
setting for WPBakery and Slider Revolution. (JibsouX)Page Speed
user agent when serving WebP images. (serpentdriver)litespeed_media_ignore_remote_missing_sizes
API description.CSS Combine
was OFF and UCSS Inline
was ON. (Ruikai)REQUEST_METHOD
is not detected.Localize Resources
feature; each localized JS resource requires thorough testing!Localization Files
value.litespeed_ucss_per_pagetype
for UCSS now also applies to CSS Combine to avoid UCSS failure. (Ankit)litespeed_media_ignore_remote_missing_sizes
to disable auto detection for remote images that are missing dimensions. (Lucas)document.referrer
.LITESPEED_ESI_OFF
now affects litespeed_esi_url
API filter too.lack_of_token
error when requesting domain key for cases where local summary value was not historically included in the array.litespeed_purge_ucss
to purge a single page UCSS. (#376681)litespeed_ucss_per_pagetype
for UCSS per page type generation. (Ankit)WP Statistics
from inline JS optimize. (Ryan D)litespeed_3rd_aelia_cookies
for Aelia CurrencySwitcher.Inline Lazy Load Images Library
option. Now will always inline lazyload library. (Ankit)document.referrer
for organic traffic purposes when Guest Mode is enabled. (michelefns)Perfmatters
. (Jeffrey Zhang)LITESPEED_ESI_OFF
constant to disable ESI, when defined before the WP init
hook.LSCWP_DEBUG_PATH
constant to specify debug log path. (khanh-nt)litespeed_ccss_url
and litespeed_ucss_url
API to manipulate the request URL for CCSS and UCSS.COOKIEHASH
constant was undefined when used with OpenLiteSpeed as an MU plugin or with network activation.Lazy Load Image Parent Class Name Excludes
failure. (thpstock)Purge Delay
in the optimization process by default..htaccess Path Settings
options for security concern. (WP)CSS HTTP/2 Push
/JS HTTP/2 Push
options. (Kevin)Guest Optimization
default to OFF.CCSS Per URL
default to OFF to avoid consuming more quota than intended after upgrade to v4. (n111)LITESPEED_CFG_HTACCESS
PHP Constant to specify .htaccess path.litespeed_qs_forbidden
hook to bypass ?LSCWP_CTRL=
query string. (minhduc)litespeed_delay_purge
hook to delay the following Purge header until the next request.litespeed_wpconfig_readonly
hook to disable WP_CACHE
constant update based on the wp-config.php file. (#633545)litespeed_optm_html_after_head
to move all optimized code(UCSS/CCSS/Combined CSS/Combined JS) to be right before the </head>
tag. (ducpl/Kris Regmi)DONOTCACHEPAGE
constant.litespeed_const_DONOTCACHEPAGE
hook to control the cache-or-not result of the DONOTCACHEPAGE
constant.UCSS Inline
option. (Ankit).UCSS URI Excludes
option. (RC Verma).litespeed_var_1_ is not defined
error when enabled w/ ESI options. (Tobolo)JS Delay
doesn’t work for combined JS when JS Combine
is enabled. (Special thanks to Joshua & Ankit)JS Delay
now will continue loading JS, even if there is an error in the current JS loading process.DONOTCACHEPAGE
constant defination to fix DIVI dynamic css calculation process.d/regionnodes
with a single d/nodes
in the node list API for image optimization.cssjs
data folder causes a failure in the upgrade process. (Joshua #PR391).litespeed-desc
class to full width in CSS.Preserve EXIF/XMP data
now defaults to ON due to copyright concerns. (Tobolo)UCSS
from CCSS
.load_queue/save_queue/build_filepath_prefix
functions. (β Contributed by Alice Tang #PR373)litespeed-optm-css-rules
to litespeed-ccss
. (Alice)CONF_FILE
constant detection.litespeed_tag
and other similar aliases for Cache Tag API.LITESPEED_BYPASS_OPTM
to LITESPEED_NO_OPTM
for Page Optimization..litespeed_conf.dat
instead of .object-cache.ini
for object cache configuration storage.lscache_vary
is already set.Separate CCSS Cache Post Types
and Separate CCSS Cache URIs
. (Joshua/Ankit)LSCACHE_NO_CACHE
will now have a higher priority than the Forced Public Cache setting._null
. (Tobolo)$_POST
to $post_data
so the database status is properly updated. (#345 Lucas)Localize Resources
option as Guest Mode is a sufficient replacement. (Note: Due to user feedback during the development period, we have decided to reinstate this option in a future version.)litespeed-info
text color. (Astrid Wang)wp_assets
from distribution to reduce the package size. (lowwebtech)Guest Mode
for instantly cacheable content on the first visit.Unique CSS
, to drop unused CSS from elements from combined CSSHTML Lazyload
option. (Ankit)CCSS Per URL
option to allow Critical CSS to be generated for each page instead of for each Post Type.Add Missing Sizes
setting for improving Cumulative Layout Shift. (Fahim)wp_update_attachment_metadata
to automate image gathering process, and to handle the new thumbnail generation after images are uploaded. (smerriman).notify_img
. (Lucas #313)Priority Line
package now can have smaller request interval.init
hook from plugin_loaded
hook.Font Display Optimization
option.data-no-optimize
to be excluded from optimization. (popaionut)Load JS Defer
and Load Inline JS Defer
options.Separate CCSS Cache Post Types
option.Separate CCSS Cache URIs
option.cssjs
.init()
instead of constructor
.cls
instead of get_instance
for init.hook_vary_add()
.vary_add()
.filter_vary_cookies()
.hook_vary()
.litespeed_vary_add
.litespeed_api_vary
.litespeed_vary_curr_cookies
and litespeed_vary_cookies
for Vary cookie operations instead.litespeed_vary_append
.append()
.CSS Combine External and Inline
and JS Combine External and Inline
to On for new installations for better compatibility.CSS Combine
/JS Combine
will now share the same file if the contents are the same. Limited disk usage for better file usage and fewer issues with random string problems.url_file
table too.Load JQuery Remotely
.false
was the value.Sitemap Generation
(will only use 3rd party sitemap for crawler).CSS Combine External and Inline
option for backward compatibility. (@lisa)Remove Comments
option to avoid combine error.data/css_excludes.txt
.data-no-defer
option now supports inline JS. (@rafaucau)Unique CSS File
option (UCSS will always generate unique file, will use whitelist to group post type to one CSS).CSS Combine
is now compatible w/ inline noscript CSS. (@galbaras)CSS Excludes
setting will no longer lose items beginning w/ #
. (@ankit)litespeed_media_reset
API function for image editing purposes. (@Andro)TypeError: Cannot read property type of undefined
.litespeed_purge_all_object
and litespeed_purged_all_object
action hooks.--format=json/yaml/dump
and --json
support in CLI. (@alya1992)url()
sources in CDN. (@daniel McD)svar
to load nonces more quickly. (@Lauren)LITESPEED_BYPASS_CDN
now will apply to all CDN replacements.Router::get_uid()
function.litespeed_buffer_before
and litespeed_buffer_after
. (#PR243 @joejordanbrown)litespeed_is_from_cloud
to detect if the current request is from QC or not. (@lechon)/litespeed-cache/data/esi.nonce.txt
. Pull requests welcome.litespeed_esi_load-
is fixed.advanced-cache.php
file detection and usage.LITESPEED_CONF__
for all settings. (@menathor)HTML Attribute To Replace
. CDN can now support any HTML attribute to be replaced. (@danushkaj91)litespeed_lazyloaded
is now appended to HTML body after lazyload is finished. (@Adam Wilson)_null
as empty value.data/consts.default.ini
.Conf::option()
. Used Conf::val()
instead.LiteSpeed_Cache_API
, need to be adjusted to the latest one. Same for ESI blocks.* ESI shortcode doesn’t change.litespeed_update_confs
to settings update.litespeed_frontend_shortcut
and litespeed_backend_shortcut
for dropdown menu. (@callaloo)litespeed_option_*
hooks. Use litespeed_force_option
hook insteadlylitespeed_force_option
to litespeed_conf_force
.litespeed_purge_single_post
.Purge All
actions. (@Monarobase)Disable All Features
now will see the warning banner if ON.log filters
section.Toolbox
section.Use Primary Site
is ON. (@mrhuynhanh)wc_session_id
to default Do Not Cache Groups setting to avoid issue where WooCommerce cart items were missing when Object Cache is used. NOTE: Existing users must add wc_session_id
manually! (#895333)widget_load_get_options()
function.Preserve EXIF data
setting. WebP will now honor this setting. (#902219)Role Excludes
setting now. (@mfazio26)LITESPEED_ERR
constant now.LiteSpeed_Cache_API::nonce_action
.data-no-optimize
in func _analyse_links
to data-ignore-optimize
to offer the API to bypass optimization but still move src to top of source code.lscwp_nonce_esi
to nonce
.parse_esi_param()
function to private and load_esi_block
function to non-static.litespeed_is_json
hook for buffer JSON conversion.litespeed_esi_shortcode-*
for ESI shortcodes.is_json
parameter.Disable All
in Debug
is ON. (@rabbitwordpress)_litespeed_rm_qs=0
to bypass Remove Query Strings./min/
.set_option litespeed-cache-cdn_mapping[url][0] https://url
.litespeed_cache_media_lazy_img_excludes/litespeed_optm_js_defer_exc
passed-in parameter is changed from string to array.lscache-admin reset_options
command.litespeed_frontend_htaccess
for frontend htaccess path.litespeed_cache_api_vary
hook outside of OLS condition for .htaccess generation.litespeed_option_
to change all options dynamically.LiteSpeed_Cache_API::force_option()
to change all options dynamically.LiteSpeed_Cache_API::vary()
to set default vary directly for easier compaitiblity with WPML WooCommerce Multilingual.LiteSpeed_Cache_API::nonce()
to safely and easily allow caching of wp-nonce.LiteSpeed_Cache_API::hook_vary_add()
to add new vary.finalize()
.CLI
no longer shows 400 error upon successful result.Purge private
/ Purge private all
/ Add private tag
functions.run()
to finalize()
in buffer process.