Minify

I have a html page stored in a database. I want to minify it before sending it back. Tried varios libs but they won't work with cloudflare. Is there a way to minify a js/css response before sending it back?
6 Replies
zegevlier
zegevlier12mo ago
Why not just turn on the built-in minification? https://dash.cloudflare.com/?to=/:account/:zone/speed/optimization then scroll down a bit to Auto Minify
Advany
Advany12mo ago
@zegevlier because its used as a api / proxy for non cloudflare managed zones/domains
Hello, I’m Allie!
If a zone can run Workers, then it can also run the Minifier
Advany
Advany12mo ago
the worker is called by a different cdn 😉
Hello, I’m Allie!
That shouldn’t matter. If a request hits a Worker(and it’s on a custom domain), then you can use Auto-Minify
Advany
Advany12mo ago
Aaah. Got it! Thanks!