3 ms·
I find REST APIs a bit annoying, primarily because of caching behaviour. For example, if I have a GET on a list of resources and then PATCH a particular resourc
by osrec 9y ago
I find REST APIs a bit annoying, primarily because of caching behaviour. For example, if I have a GET on a list of resources and then PATCH a particular resource from the list, the browser will still keep the old list in cache and not update (with the newly patched resource) till the cache expires. For this reason, I just use my own json APIs using POST requests (to bypass the cache) with some application specific caching in the browser via indexedDB - it's not that much more work, but the experience is significantly better for the user.
- paulddraper 9y agoHTTP caching behavior is extremely flexible. You could use must-revalidate with ETag or If-Modified-Since caching.
- osrec 9y agoTrue, but the whole process becomes a bit convoluted. I feel it's easier to just stay away from HTTP caching where possible.
- paulddraper 9y agoIt's always possible. It's just not always performant.