OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
241 stars 50 forks source link

Only set Cache-Control header if HTTP cache is enabled #136

Closed fabian closed 8 years ago

fabian commented 8 years ago

I propose we remove the default cache setting and only set a max-age if the HTTP cache has been enabled in the settings.

Change in HTTP response headers:

- Cache-Control: public, s-maxage=30
+ Cache-Control: no-cache

For most applications it's preferable to get the most recent response from SBB to detect delays or track changes. Having the rate limiting prevents too many requests. Caching by an intermediary proxy also makes the rate limiting behaving unpredictable.

Unless concerns are raised I will merge this change on 12 June 2016.