Every day when a website is being released in the world of web development and design, not only people aim for acquiring the first place on the first page, but also optimize their website for speed.
Aside from writing many blog posts or having the best functionality with your plugins, you also need to have a plugin configured to cache and serve cached pages.
If you haven’t already heard, speed is all that matters for users to come to your website.
It doesn’t matter if you have the best article, which would catch each visitor’s eye, because a website that takes more than 3 seconds to load will not be visited often.
In fact most of the websites are loaded through mobile phones, which means that it takes a bit more effort to setup an effective caching and achieve the under 3 seconds loading rule.
Over the years people have switched to their mobile devices and tend to read much more, as smartphones can be taken anywhere and at any time.
If your website is not optimized for mobile users, you will be missing a lot.
This guide is self made and differs from most of them. It is not sponsored and will not slow down your website like WPCrafter’s guide.
Table of Contents
LS Cache vs WP Rocket vs W3 Total Cache
Depending on your liking or plugin that you are willing to use, we have made this article, so you can find help for any of the top caching plugin such as W3 Total Cache, LiteSpeed Cache (LS Cache) and WP Rocket.
Apart from the other plugins, LS Cache is having the option to optimize your images, which can save time and resources for downloading plugins to do the job for you.
They also offer an image transformation to WEBP format, which saves a ton of space on your website and reduces its page size significantly.
WP Rocket is another well known plugin that can save your time, with beginner friendly set of options and lets you easily configure how your website should be cached, which is critical for newbie users.
Apart from the settings, which are almost mutual to LS Cache, WP Rocket has an easy option to combine and minify the JS, which your website is using, without damaging external JS scripts.
These scripts are known as Google Analytic Scripts, Google Adsense Ad scripts and Media.net Ad Scripts.
In order to configure LS Cache to not combine and minify these external scripts, you can turn off the option, or exclude the scripts that should not be fetched by the option.
W3 Total Cache is another significant life saver plugin, but has the hardest configuration for newbie users and can easily break your website.
It’s structure and set of options is similar to LS Cache and WP Rocket, but the way your options are explained is a bit tricky.
Not only you should be careful not to break the HTML, CSS, JS or your internal PHP calls, but you should also pay extra attention how you are configuring CloudFlare.
For those of you, who have not heard about CloudFlare, it is a CDN, which can be used in various ways.
You can minify your websites HTML, CSS, JS.
Accelerate your website speed with their Rail Gun option.
Set a list of Workers who will take care of the speed for you.
Configure page rules, but can be risky as your plugin may do the same and result in conflict.
Cache and serve your website through any point in the world, without resulting in tons of loading times.
If we had to choose between LS Cache, WP Rocket and W3 Total Cache, our top pick would be LS Cache, due to the QuicCloud CDN and our technical skills.
But these 3 plugins compared to each other are all special in their own way.
As you can see LS Cache can handle more Requests per Second, while WP Rocket stands on second place, but WP Rocket does not need a LiteSpeed web server configured to work for you.
Even though W3 Total cache is having less requests that WP Rocket or LS Cache, it is more reliable and better used with a CDN and less risk of having 2 settings doing the same and creating conflicts.
Optimize website with LS Cache
The setup provided for LS Cache is currently our setup and is perfect for people who serve ads, without the need of excluding any type of script.
You can still change your options however you like, but keep a copy of the configuration just in case, if you get lost configuring.
LS Cache Settings
Enable Cache – The trigger of the Cache option
Cache Logged-in Users – You do not need to have this option enabled as you need to see the latest updates on your website. In case you have a user membership plugin, you can turn this plugin on.
Cache Commenters – Caching commenters is not recommended as you will be caching comments anyways.
Cache REST API – Caching REST API is not recommended for users who have certain API integrations.
Cache Login Page – Caching login page is not needed as your login page never changes, but if you have a dynamic login page, you can always enable this option.
Cache PHP Resources – Caching the PHP resources is mainly depending on your WordPress theme, but problems have not occurred until now.
Cache Mobile – Caching the mobile page is recommended only if you are using the WordPress AMP plugin as this option is suited for it. It does not work for mobile friendly themes without AMP.
It took me quite long time to figure out the best settings, but I had found out that 6 months of caching is a great start for my websites.
If you are serving dynamic content, it will not hurt you to set the LiteSpeed Cache Time To Live settings to 6 months of caching.
As for the example, you can copy my settings and set each of the following to 15778476 seconds to live. As for the default Private Cache TTL, LS Cache will not impact the website visitor.
Default Public Cache TTL – 15778476(Can be left as Default too)
Default Private Cache TTL – 3600 (Can be left as Default too)
Default Front Page TTL – 15778476(Can be left as Default too)
Default Feed TTL – 15778476(Can be left as Default too)
Default REST API TTL – 15778476(Can be left as Default too)
Default HTTP Status Code Page TTL – Leave as default
Purge settings should be left as they are on default, but you can also make some changes as to purge:
- All Pages
- Front Page
- Home Page
- All pages with Recent Posts Widget (Recommended for dynamic widgets)
- Author Archive (If you have one)
- Post type archive (recommended)
Excludes can be left as they are, except if you know what you are doing.
Even though the purpose of LiteSpeed Cache is to optimize your website to its fullest, we still do not recommend running into this, except if you have the URL’s you want to exclude.
Turning off your ESI settings is beneficial no matter what.
ESI may interact in a really bad way with your website, causing problems with caching and serving.
Note that if you have ESI turned off, the other options will not operate even if they are turned on.
Depending on your hosting provider, you should have Memcached and Redis extensions by default.
If not, you can ask your hosting provider to install them for you, as you will need them for object caching.
Object cache – Should be always turned on and have your Redis Extension installed in your hosting plan.
Method – Method should be chosen as Redis Extension and should be Enabled.
Host – The IP address of the Redis extension. You can find it once you create an instance in Redis.
Port – The port address, which is shown in Redis. You can also find it once you create an instance in Redis.
Default Object LifeTime – Can be left as default.
Username – The Redis username is provided by your Redis extension upon creating instances. It’s not always needed, so do not panic.
Password – The password is acquired through the Redis extension upon creating and instance.
Browser Cache – Stores all the static files locally, so users do not have to download your website’s information all the time. Saves space and improves speed.
Browser Cache TTL – Can be left as default.
Advanced Cache Settings
These settings can be left turned off and blank, as they may result in conflicts with different users.
Login Cookie – Sets a cookie, which can check if the user has already downloaded the website content, as different links exist.
It is still not used by our side, because it may generate more cookies than usual and mess up the user experience.
Improve HTTP, HTTPS Compatibility – If your website is loading both HTTP and HTTPS files this option may be perfect for you.
As another example I would say when visitors try to access your website through the HTTP version, they will get redirected to the HTTPS one.
Still this option resulted in conflicts for us, but you can use it.
QUIC.cloud CDN – If you want to register or have a registration on QUIC.cloud you can turn this option to use it
USE CDN Mapping – Using CDN mapping is not recommended as the usual CDN’s that you will be using are CloudFlare and Quic.cloud. They do not use CDN Mapping and could cass errors.
CDN URL – This is the URL that will be used when serving images and other elements.
CloudFlare Integration should be ON. A username and password are also needed to be integrated with LS Cache
Image Optimization Settings
Auto Request Cron – Automatically request images to be optimized rather than manually optimizing them.
Auto Pull Cron – Pull all images through Cron.
Optimize Original Images – Optimize your already existing images (saves a ton of space).
Remove Original Backups – Normally we wouldn’t recommend this, but if your hosting plan is limited on space, you can turn this option ON.
Optimize Losslessly – If you already have a plugin, which is optimizing your images Losslessly it is not recommended to turn this option on.
Remove EXIF/XMP Data – With this option you can reserve your pictures so they are not used, but will result in increcement of space.
Although it would be good to preserve images, you never know if you actually own copyrights.
Does not apply for photographers, which create their own pictures and not use Stock Footage.
Create WebP Versions – Changes your images format to WebP, which results in faster loading times and drastically reduces the image size.
Image WebP Replacement – Replaces current images, which have different format to WebP, which helps with faster website loading times.
CSS Minify – Minifies existing CSS files. You may see style.min.css, which is the idea to save resources.
CSS Combine – Combines existing CSS into one file in order to reduce many repetitive requests. You can keep this option turned ON, but if your website has loading issues, turn it OFF.
Generate UCSS – Depending on your theme, the UCSS may be a helpful option for your website. In most cases the Unique CSS that is generated breaks websites, as it strips the unused CSS from the active one.
UCSS Inline – If you are generating Unique CSS you can turn this option on, so you can inline it and save page space and site speed.
CSS Combine External and Inline – If you are loading external CSS, it will be a good idea to combine it and inline with your existing CSS as this will save you time and speed up your website.
Load CSS Asynchronously – Loading your CSS asynchronously can help your website load the HTML first and then start paint. It helps you reduce the server loading time and initial issues with slow loading.
You can Exclude this as an option in the Tuning tab.
JS HTTP/2 Push – Optimizes the JS, but needs the HTTP/2 Push protocol supported by your browser.
Load JS Deferred – Reduces the resources cost and improves website speed
Local Inline JS – Localizing and inlining the existing JS should be Deferred, as it can help with website speed.
CSS/JS Cache TTL – CSS/JS Cache Time to live should can be left as default, but we use 2592000s
LS Cache HTML settings
While a CDN should be set to cache your website’s HTML, LS Cache offers HTML minify, which is a no-brainer and should be kept on, so all of your HTML can load quicker.
DNS Prefetch Control – DNS Prefetch control will follow a list specified of URLs to prefetch, before the browser gives a status of 200. Remember that this option may expose your domain and other information. For security purposes, I keep this option turned OFF.
Remove Query Strings – Removing Query strings from your website is a good idea, but if your website is using Google Captcha, LS Cache will disregard it and may cause issues with your speed.
Load Google Fonts Asynchronously – While your website is loading the HTML and CSS, LS Cache will prevent fonts Google fonts from loading along with them and causing render blocking issues.
Remove Google Fonts – In order for LS Cache to remove Google Fonts from your website and prevent your theme loading them, you will need to host them locally.
This means that you will need to download and upload fonts to your website, so they can be hosted and loaded directly from your server.
Remove WordPress Emoji – If a plugin or theme does not have emojis, which can be used for reactions, you can safely remove the WordPress emojis with LS Cache.
This option will also remove the default WordPress emojis, which can be used while commenting.
Remove Noscript Tag – Removing the Noscript tag is not a big deal, as LS Cache will just strip a part of your HTML. It will not break any of your codes, as Noscript is used to notify the search bot the text areas and others. It does not affect SEO rankings in any kind of way.