by TheChaplain · 2y ago · 0 comments
Escaping/sanitizing on output takes extras cycles/energy that can be spared if the same process is done once upon submission.
Think more sustainable.
It surprises me that this seem unfamiliar these days?
For most real world use cases your approach is break even at best, and often way worse.
Maybe if you also directly render some html from the backend, that would change things.
Document these assumptions in your central code standards/architecture document to get everyone aligned, and then just stick to it and enjoy a more sane codebase.
Of course you'd need to measure this for your application, but without a performance measurement maybe it's better to default to security.