How can I prevent Cloudfare from deleting a HTML tag?

Viewed 48

A client is using Cloudfare to deliver his web content but their filters are removing tags that are unknown to them. Unfortunately that breaks the service that we provide.

For example, before the DOCTYPE tag we use a tag of our own like <!-- Example --> which tells our server filter to encrypt the HTML that follows. But Cloudfare filters are removing that tag, and thus breaking the service.

Do they have a whitelist or something that can be used to prevent the corruption?

2 Answers

You Just don't minify the HTML,CSS And JavaScript. just skip them while you adding the domain. it works for me.

So you want to preserve html tags similar to "comments" that don't normally appear on a page?

Page speed modifiers strip such tags because they are not important to a page and thus are not necessary. By removing all comments a few Bytes can be removed from the download of a page. On most pages that will make little difference, but some websites, especially those running a CMS with a multitude of plugins, can contain a lot of comments.

So it is page speed enhancement that you need to disable to preserve such tags.

Cloudfare provides a Control Panel to make adjustments. In the top menu, click on "Rules" to Create a Page Rule for your website. Then enter the URL of the page that you want to exempt. Enclosing the URL in asterisks [*] will cater for all similar urls, like example.com/special. Then pick a setting by selecting "Disable Performance".

This will create a rule to disable pagespeed enhancement of all pages that include "example.com/special" in their URL.

Related