Ignore JavaScripts
Last updated Apr 17, 2026
You can have Rocket Loader ignore individual scripts by adding the data-cfasync="false" attribute to the relevant script tag:
<script data-cfasync="false" src="/javascript.js"></script>
Rocket Loader will still optimize the loading of all other scripts on the page.
Note
If Rocket Loader is only impacting a specific page, use a Configuration Rule to exclude that page by URL.
Limitations
- Adding this attribute within JavaScript will not work if you wish to exclude the script from Rocket Loader.
- If the script you want Rocket Loader to ignore has dependency on other JavaScript(s) on the page, those dependencies must also have the
data-cfasync="false"attribute. - The
data-cfasyncattribute must be added before thesrcattribute. - Rocket Loader will recognize the tag when either single or double quotes are placed around the attribute value.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"WebPage","@id":"https://developers.cloudflare.com/speed/optimization/content/rocket-loader/ignore-javascripts/#page","headline":"Ignore JavaScripts","description":"Exclude specific scripts from Rocket Loader optimization.","url":"https://developers.cloudflare.com/speed/optimization/content/rocket-loader/ignore-javascripts/","inLanguage":"en","image":"https://developers.cloudflare.com/speed/optimization/content/rocket-loader/ignore-javascripts/og.png?v=8a1f4f6a456a1fff","dateModified":"2026-04-17","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["JavaScript"]}
description: Shared dictionaries reduce repeat-visitor transfer size by compressing each response against a version the browser already has cached. title: Shared dictionaries image: https://developers.cloudflare.com/speed/optimization/content/shared-dictionaries/og.png?v=52503ae4d2af2d59
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/speed/llms.txt
Use this file to discover all available pages before exploring further.
Docs