LiteSpeed Cache is a popular and powerful WordPress caching plugin, especially when used with LiteSpeed web servers. It offers a wide range of features to enhance site performance, including page caching, minification and combination of CSS and JavaScript files, deferred script loading, image optimization, database cleaning, and more.
With proper configuration, LiteSpeed Cache can work seamlessly with My Agile Privacy, ensuring both optimal speed and full GDPR compliance. Here’s how to adjust LiteSpeed Cache to avoid conflicts with your privacy plugin:
To make sure My Agile Privacy runs smoothly, you must exclude certain JavaScript files from LiteSpeed Cache’s optimizations (both minification and deferred/lazy loading).
From your WordPress admin, go to LiteSpeed Cache > Page Optimization.
In the JS Excludes section, paste the following (one path per line):
/wp-content/plugins/myagileprivacy/frontend/js/my-agile-privacy-frontend.js
/wp-content/plugins/myagileprivacy/frontend/js/anime.js
/wp-content/local-cache/my-agile-privacy/cookie-shield.js
/wp-content/local-cache/my-agile-privacy/MyAgilePrivacyIabTCF.js
/wp-content/plugins/myagileprivacy/local-cache/my-agile-privacy/cookie-shield.js
/wp-content/plugins/myagileprivacy/local-cache/my-agile-privacy/MyAgilePrivacyIabTCF.js
/wp-content/plugins/myagilepixel/frontend/js/myagilepixel.js
/wp-content/local-cache/my-agile-pixel/cookie-shield.js
/wp-content/local-cache/my-agile-pixel/myagilepixel.js
/wp-content/plugins/myagilepixel/local-cache/my-agile-pixel/cookie-shield.js
/wp-content/plugins/myagilepixel/local-cache/my-agile-pixel/myagilepixel.js
On the same page, find the JS Deferred/Delayed Excludes option and repeat the same list above.
Be sure to save your changes before continuing.
To avoid issues with how your cookie banner or privacy tools display, you’ll need to exclude My Agile Privacy’s CSS files from optimization.
In LiteSpeed Cache > Page Optimization, open the [9] CSS Optimization tab.
Under CSS Excludes, add the following (one per line):
/wp-content/plugins/myagileprivacy/frontend/css/my-agile-privacy-frontend.css
/wp-content/plugins/myagileprivacy/frontend/css/my-agile-privacy-notification-bar.css
/wp-content/plugins/myagilepixel/frontend/css/mapx.css
/wp-content/plugins/myagileprivacy/frontend/css/animate.min.css
Again, don’t forget to save.
Depending on your LiteSpeed Cache version and settings, you may also need to disable these options for full compatibility:
If you need assistance or encounter problems, feel free to contact our support team or reach out to LiteSpeed Cache’s support.