5 ms·
>(of course, the server must continue to honor all previously-issued URLs). Why is this true for non-user facing urls? Seems like an argument could be made th
by jayd16 8y ago
>(of course, the server must continue to honor all previously-issued URLs).
Why is this true for non-user facing urls? Seems like an argument could be made that you only need to support the urls for as long as the response was cacheable.
- emn13 8y agoAnd the problem isn't really limited to links in the response; the same goes for computed links based on keys too. In fact, links in responses are probably easier to update, because waiting for client software to upgrade can take a long time - but waiting for old versions to fall out of caches or at least dwindle to a small enough number is likely a much shorter wait. Furthermore, when your clients are composing links based on keys, there's no good way for the server to tell a client that the uri has changed - the composition is in the client, and the key (presumably) hasn't changed, so the thing the server would want to update is out of conventional reach. But with uri's there's at least a conventional solution - redirects. That's not going to be an ideal solution; but as a way of limiting transition pain it might have a place. All in all, I think links are likely less painful to use than keys when it comes to uri routing changes. (But really, try to avoid changing uri's in the first place, because whatever you do it's likely going to be painful somewhere).
- barrkel 8y agoIt's an API. The client isn't likely to be a browser. If it's integrating with another system, those links may have quite a long life.
- randallsquared 8y agoCaching behavior is not only about browsers.
- barrkel 8y agoFor sure, but for most people using APIs to integrate with systems, caching is an unwanted middle way between always fresh and stored persistent, where local storage is the "cache", except it isn't invalidated using HTTP logic.
- jayd16 8y ago>except it isn't invalidated using HTTP logic. You should be doing this. It helps a lot, actually.
- mpnally 8y agoCache timeout limits generally apply to the data retrieved for a URL, not the URL. If you know that your clients will never "bookmark" or in any way store URLs, then you can change them. The same rule applies for all identifiers, not just URLs