Cannot use Cloudflare Rocket Loader manually using wp_enqueue_script

I have several plugins on my wordpress site that relies on the wp_enqueue_script function. I recently had a client that uses Cloudflare, who wants to implement Rocket Loader, which is an automatic asynchronous javascript loader. The problem is that several scripts do not work with it, so I have to disconnect them from automatic asynchronous loading.

According to the Rocket Loader wiki. I need to insert the data-cfasync = "false" attribute into a tag that doesn't seem possible using the wp_enqueue_script function.

Are there other ways to define these attributes? If not, is there another way to prevent Rocket Loader from loading from asynchronously loading these specific scripts?

+5
source share
2 answers

I am an engineer who supports Rocket Loader. Unfortunately, without direct access to the script's HTML tags, there is currently no way to manually disable the Rocket Loader for individual tags.

One possible solution is that you can use our Page Rules feature to selectively disable Rocket Loader on all pages that match the base template. If you think this is the right solution for you, log in to your CloudFlare account and see "Page Rules."

: WordPress, wp_enqueue_script CloudFlare Rocket Loader. WordPress , , CloudFlare.

, , - , , , Rocket Loader. JavaScript , , wco [at] cloudflare [dot] com, !

+2

CloudFlare. , Rocket Loader .

+1

All Articles