xml-to-json
xml-to-json copied to clipboard
Add some Cache-Control / Expires headers?
Right now you don't return any Cache-Control
and Expires
headers so every time the browser makes a request it downloads the whole response again.
I'm not sure what kind of caching you do on your side but it's unlikely that the xml would change every couple of minutes so I would at least have some client side caching.
Otherwise maybe you could have an extra parameter like &cache=30
which controls the amount of minutes after which the response expires.
By the way if you submit the xml directly in the URL obviously the response never changes so you should have something like Cache-Control: public, max-age=31536000, immutable
(longest cache possible).