How can I have Rocket Loader ignore my script(s) in Automatic Mode? - monlife

Hot

Post Top Ad

Monday 23 October 2017

How can I have Rocket Loader ignore my script(s) in Automatic Mode?




You can have Rocket Loader ignore individual scripts by adding the data-cfasync="false" attribute to the relevant script tag, for example: 

      <script data-cfasync="false" src="/javascript.js"></script>      

Rocket Loader will still work for all other scripts.

Notes:
1. Adding this attribute within JS will not work to exclude the script from Rocket Loader.
2. The 'data-cfasync' attribute must be added before the 'src' attribute. 
3. Rocket loader will recognize the tag when either single or double quotes are placed around the attribute value. 
Alternative:
If Rocket Loader is only impacting a specific URL, then please look at using a PageRule to exclude that URL from optional performance features.

No comments:

Post a Comment

Post Top Ad