LastFM API used to expose "Cache-Control
" header in HTTP answers. Instead here is what I got:
curl --head "http://ws.audioscrobbler.com/2.0/?api_key=APIKEY&artist=NOFX&autocorrect=1&format=json&method=artist.getsimilar&results=100"
HTTP/1.1 200 OK
Server: openresty/1.9.15.1
Date: Wed, 13 May 2020 09:44:27 GMT
Content-Type: application/json
Connection: keep-alive
content-length: 81358
Access-Control-Allow-Methods: POST, GET, OPTIONS
Access-Control-Allow-Origin: *
Mandats-contributions: 86400
Since last.fm "term of use" require us to implement some kind of caching (which is sensible for any kind of use on the web anyway), I'm wondering: how do I implement it with such answers?
When I noticed "Cache-Control
" header disappearance I forced an hardcoded cache of 1 month in the code overriding the regular "Cache-Control/Etag/…
" caching logic.
I may have overlooked something here, I'm no expert. But I hoped there was a better solution than keeping a static 1 month cache.