Use Caddy to beautify served html

I’m using Caddy 2 as a reverse proxy and static file server in front of Django. Django rendered HTML is, how to say, ugly, so I though to use some Caddy feature (a plugin, call an external command, …?) in order to beautify the markup and serve the formatted version (I’ll then evaluate how/if this process will impact on performances and then decide).

Is it possible and any idea how?

That’s a bit of a vague question, I’m not sure I understand your goals. Are you looking to syntax format the HTML content being returned from Django? That seems unnecessary, browsers don’t care about syntax formatting.

Could you clarify what you mean?

That said, Caddy supports plugins written in Go:

I need to change the HTML markup returned from Django giving it the proper indentation. I could also need the opposite, get the markup and apply minification.

Thanks for the link, I don’t know Go but I found something (1, 2) I can try to integrate.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.