Skip to content

Instantly share code, notes, and snippets.

@chrisdlangton
Created August 31, 2016 23:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisdlangton/ccd46008fee636f341deb35ef1e86c80 to your computer and use it in GitHub Desktop.
Save chrisdlangton/ccd46008fee636f341deb35ef1e86c80 to your computer and use it in GitHub Desktop.
A language agnostic interface for a caching strategy
protocol CacheKeyStore
prop storeName = 'my cache key store name'
prop delimiter = '|'
func <void>
set => <str> cacheKey,
<str> json
func <str|cacheKey>
makeKey => <str> __CLASS__,
<str> __METHOD__,
<str> handledInput
func <str>
exists => <bool>
func <str>
fetch => <str> cacheKey
func <void>
delete => <str> cacheKey
func <void>
deleteAssoc => <str> cacheKeyPart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment