Skip to content

Instantly share code, notes, and snippets.

@seriousManual
Last active August 29, 2015 14:06
Show Gist options
  • Save seriousManual/761f2d9dc5b252f92e29 to your computer and use it in GitHub Desktop.
Save seriousManual/761f2d9dc5b252f92e29 to your computer and use it in GitHub Desktop.
REST API invalidation scheme
thoughts on possible concept to cache responses of a rest api
* save any response to GET with the called URL as the key (including relevant get parameters like limit, offset or order)
* on each POST to a certain resource invalidate cache keys by the following scheme
POST /user
/user(\?(.+))?
POST /user/1/transaction
/user
/user?(.*)
/user/1
/user/1/transaction(\?(.+))?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment