• Hi Guys,

    Quick question…

    How does one exclude a particular js file from being cached? In our case a privacy plugin requires a js file not to be cached but I can’t seem to find where to do that.

    Cheers,

    Gerard

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    You can find “JS Excludes” TextArea under the “Tuning” Tab, if you don’t see the Tuning tab please click on green button “Show Advanced Options” at top right in the plugin settings page.

    You can put the name or a just a part of the javascript’url you want to exclude, I had an issue minifying/combining a javascript file, excluding it resolved my problem.

    Cheers.

    Thread Starter iamgerardthomas

    (@gerard70)

    @lhoucine thanks for that. That’s what I did but the text for the field seems to imply this is only to prevent it from being minified (I am not minifying js)

    Hi,
    There are 3 suggestions you can try :

    1 – consider to add a query string when queuing your script, example /…/my-script.js?ver=213133254 , you can use a time function to generate the version number, so you can prevent browsers from caching your script.
    2 – also you can try to exclude it from combining
    3 – then try to check if “Remove query strings from static resources” is disabled

    I hope this helps you

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    You can check http header on that JS file , it should not be cached , unless you see “x-litespeed-cache: hit” header.

    Best regards,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude JS file’ is closed to new replies.