Skip to content

How To Disable LiteSpeed Cache Optimizations for WebView, Instagram User Agent

by Yaron Elharar (@YaronElharar)

At the time of this writing LiteSpeed Cache optimizations conflict with Android In-app browsers (WebView), Instagram. For me at least it caused multiple things to stop working for example carousels, forms, positioning of elements, interactive menus not opening etc.

Disabling the optimizations through the interface made no difference, until the issue is fixed the best available solution is to exclude android web view from being optimized by LiteSpeed Cache

You can see a short discussion about this here (Slack Chat)
https://golitespeed.slack.com/archives/C3QRCDP44/p1653557443022489

For now you can add this piece of code to your wp-config. php file (WordPress root folder) to disable LiteSpeed cache for WebView in Android lollipop and above


// Disable Litespeed optimizations for android WebView Lollipop and Above

if (stripos($_SERVER['HTTP_USER_AGENT'],"; wv")!==false ) {
define( 'LITESPEED_DISABLE_ALL', true );
}

If you want to expand on this and disable WebView for other versions of android you can check out this document from Google

Back To Top
Skip to content