With Cloudflare workers we can control some Cloudflare features like we can with CF Page Rules. Example whether to minify requests
cf: { cacheTtl: cacheShort, minify: { javascript: true, css: true, html: true } }
@signalnerve any plans to add support for controlling whether Railgun is enabled or not too ?
like
cf: { cacheTtl: cacheShort, railgun: false }
Cloudflare features all plans can set on outbound requests:
-
cacheEverything
:This option forces Cloudflare to cache the response for this request, regardless of what headers are seen on the response. This is equivalent to setting the page rule “Cache Level” (to “Cache Everything”). (e.g.true
) -
scrapeShield
: Toggles ScrapeShield. (e.g.false
) -
polish
: Sets Polish mode. The possible values are “lossy”, “lossless” or “off”. (e.g.lossless
) -
minify
: Enables or disables AutoMinify for various file types. The value is an object containing Boolean fields forjavascript
,css
, andhtml
. (e.g.{ javascript: true, css: true, html: false }
) -
mirage
: Disables Mirage for this request. When you specify this option, the value should always befalse
. (e.g.false
) -
apps
: Disables Cloudflare Apps for this request. When you specify this option, the value should always befalse
. (e.g.false)
-
cacheTtl
: This option forces Cloudflare to cache the response for this request, regardless of what headers are seen on the response. This is equivalent to setting two page rules: “Edge Cache TTL” and “Cache Level” (to “Cache Everything”). (e.g.300
) -
resolveOverride
: Redirects the request to an alternate origin server. You can use this, for example, to implement load balancing across several origins. (e.g.us-east.example.com
)- Note - For security reasons, the hostname set in
resolveOverride
must be proxied on the same Cloudflare zone of the incoming request. Otherwise, the setting is ignored. CNAME hosts are allowed, so to resolve to a host under a different domain or a DNS only domain first declare a CNAME record within your own zone’s DNS mapping to the external hostname, set proxy on Cloudflare, then set resolveOverride to point to that CNAME record.
- Note - For security reasons, the hostname set in