Wordpress LScache Plugin: Problem with localize resources option
Last Updated on: Wed, 15 Apr 2026 00:00:02 Hi, for me the option to localize resources simply does not work. The link is changed as it should but theres apparently no such resource on server. To me it seems the plugin lacks some permission to create the directory in wp-content and place resource there, although I have no idea how to debug this. Also I have a question about your suggested resources list ? why you add Google maps there? I suppose they cant work that way, am I wrong? Hi, despite you see .js in the URL , but its actually a rewritten PHP request , thats why you dont see it if you have subdir .htaccess in /wp-content/.htaccess this will override the rewriterule on parent .htaccess that links to /index.php which also breaks it now may I know what exactly do you mean by not work ? any more specific symptom ? link give 404 ? link content empty ? or something ? Best regards, I found different patterns for different resources. I will list all of them: 1) 3rd party plugin (Judge.me) loading 1 css and 1 js file from CDN. Looks like the problem was related to the fact that only JS resources are localized, so CSS file was not loaded. But when I copy CSS file to wp-content/litespeed/localres/ folder manually it works well. Why you decided to restrict this function to JS only? 2) Google analytics are still loaded from Google servers. Maybe this is related to particular implementation in GA plugin. Any way I highly doubt they would work locally without some additional configuration. 3) Google Maps are not loaded at all. There are no related resources in network tab, but theres a related JS error in console. Maybe this is due to the theme. But again I highly doubt Google Maps can work locally. Can you please explain how this function works? The folder wp-content/litespeed/localres/ is virtual and it is always redirected somewhere? I was not able to find JS files anywhere, where are they stored? I was not able to find anything localres related in my .htaccess files, so what code in .htaccess is responsible for redirection? Hi, 1) because currently only supports JS , CSS and font were still on to-do 2) you can check our source code for how localization works. 3) I have noticed in some cases (though I didnt find any pattern for this issue) , some times , google allows plugin to retrieve the content of their file , but sometimes it only returns 400 bad request , and when that happens , thing breaks The folder wp-content/litespeed/localres/ is virtual and it is always redirected somewhere? I was not able to find JS files anywhere, where are they stored? its redirected into wordpress index.php its just kind of like a very special post of your WP , except it has permanlink to /wp-content/litespeed/localres/xxxxxx so it doesnt really exist within your wordpress strcture , it is real-time generated by wordpress, and then stored into cache root set by server (assuming you are using cPanel , then it will be /home/user-name/lscache/) Best regards, Hi again. Theres another issue with localized JS resources ? they are not deferred when corresponding option is turned on in Litespeed settings. Hi, how can I reproduce it ? I tested as : all JS options are OFF , only defer JS is on , then localize it , from my source code I see it is deferred then I combined/minify/combine external/inline , all my JS moved at footer and deferred Best regards, Maybe the problem is related to the fact that script already has async attribute in my case? With localize and defer off: With localize and defer on: Hi, yes , from code private function _js_defer( $ori, $src ) if ( strpos( $ori, async ) !== false ) return $ori if async presents, it will bypass Best regards, Is there any way to bypass your bypass without modifying Litespeed code? I am rather sure that plugin author used async just to be on the safe side and dont deal with some edge cases and on my installation nothing will break if plugins javascript is switched to defer. Hi, but whats the point to defer an asynced JS ? since its already not-rendering-blocking Best regards, With async it is downloaded too early and its execution is blocking HTML parsing, so defer would provide better result for that script. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script then maybe you can remove async attr ? Hi, Im going to mark this topic Resolved , due to lack of activity. If you still need help, please feel free to re-open it. When re-open it, please also change the topic status to not solved Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference