@insecttrojan please provide us a Report Number. This can be generated in LSC => Toolbox => Reports => and click on “Send to Litespeed”.
Thank you 🙂
OK I did it the number is
JBOTNCJG
Just to make sure I understood corectly: query string is not removed from .css and .js files, yes?
-
This reply was modified 1 year, 4 months ago by
litetim.
Plugin Support
qtwrk
(@qtwrk)
you mean like this one ? /wp-content/litespeed/js/96145808334e4667de28e0b9e0c419c9.js?ver=091ba
it’s deliberately added
function remove_version_query( $content ) {
return preg_replace('/(\.js|\.css)\?ver=' . LSCWP_V . '/', '$1', $content);
}
add_filter( 'litespeed_buffer_after', 'remove_version_query', 0);
you can try this code snippet
-
This reply was modified 1 year, 4 months ago by
qtwrk.
yes the version I mean thanks for your help but i did it and it not removes the query string of version
Plugin Support
qtwrk
(@qtwrk)
oh , I see, my bad, copy paste the code snippet for other similar issue but not same as yours
try this
function remove_version_query($content) {
return preg_replace('/(\.js|\.css)\?ver=[^&\'"]+/', '$1', $content);
}
add_filter('litespeed_buffer_after', 'remove_version_query', 0);
it works now thanks a lot
Plugin Support
qtwrk
(@qtwrk)
this will probably remove all and any js/css in form of ?ver= , even not belong/generated by our plugin , so please check around a bit and make sure everything works
or use
return preg_replace('/(\/wp-content\/litespeed\/[^\/]+\/[^\/]+\.(js|css))\?ver=[^&\'"]+/', '$1', $content);
to do narrower match for only /wp-content/litespeed/.......
-
This reply was modified 1 year, 4 months ago by
qtwrk.