Enable Cache Deception Armor Cloudflare features that can alter your HTML and cacheable objects.Configure Cross-Origin Resource Sharing (CORS).Protect your site from web cache deception attacks while still caching static assets. Enable Prefetch URLs (Enterprise only) External link icon Open external link Secure your cache configurationĬontrol resources a client is allowed to load and set access permissions to allow different origins to access your origin’s resources.Configure custom cache keys (Enterprise only).
Include or exclude query strings, optimize cache keys, or enable tiered cache to improve hit rates and reduce traffic to your origin.
Of course, you can also turn off the global pair directly HTML Of Auto Minify, Or use DOMContentLoaded The event HTML Page passing To configure Page Rules Page rules close Auto Minify, The actual measurement can also solve the problem.
The only disadvantage of this is that document.readyState by complete Only when the DOMContentLoaded event, But this is the price that must be paid now.
Cloudflare auto minify code#
This code determines if load After the event DOMContentLoaded The incident hasn't happened yet, Is triggered manually by the code DOMContentLoaded event, So that DOMContentLoaded The event is equivalent to load event. Then I embed the following code into the web page, Every time the output state changes document.readyState Value : console. addEventListener ( "DOMContentLoaded", foo ) } First of all, I ruled out the problem of the website code itself, Because the website works normally locally, And I also ensure that in document.readyState by interactive And complete Execute function directly when : if (document. However, Turn on at the same time HTML Auto Minify And Rocket Loader after, Visiting the website, I found that it originally triggered window Of DOMContentLoaded The functions defined to be executed after the event are not executed. Stay loading -> interactive Changes between states trigger window Of DOMContentLoaded event, stay interactive -> complete Changes between states trigger window Of load event.
Auto Minify And Rocket Loader brief introductionĪuto Minify You can delete the website source code ( Include CSS,Javascript and HTML) Unnecessary characters in ( Such as spaces and notes ), To compress its file size, Reduce the amount of data that needs to be transmitted to visitors, Thus reducing the page loading time. Cloudflare Can optimize the website, But it's opening HTML Auto Minify And Rocket Loader when, Found that when visiting a web page DOMContentLoaded Missing event. Recently will My website DNS The whole analysis moved to Cloudflare Up.