xml-to-json icon indicating copy to clipboard operation
xml-to-json copied to clipboard

Add some Cache-Control / Expires headers?

Open GitBoudewijn opened this issue 3 years ago • 1 comments

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.

GitBoudewijn avatar Nov 18 '21 12:11 GitBoudewijn

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).

GitBoudewijn avatar Nov 19 '21 01:11 GitBoudewijn