Investigation of Cache in REST handler #13

Closed
BradMclain opened this Issue Feb 25, 2013 · 8 comments

Projects

None yet

2 participants

@BradMclain
Member

parameter set -> get_cache_key

@devraj devraj was assigned Feb 25, 2013
@BradMclain
Member

Implement this as part of the RequestHandler.

Application asks for a key based not he request method and the currently parameters.

Handler must return a key, or None. If None returned Caching process is skipped.

Application must pass a reference to a Cache Provider.

Cache Provider abstracts get / set.

@BradMclain
Member

Tried implementing this as a decorator, problems surround passing instance reference.

decorators seem to function on a class level.

Need to rethink the key generation and action.

@BradMclain
Member

Refer to implementation using decoators for rules and CacheKeyProviders.

@BradMclain
Member

Introduces CacheKeyProvider, to be used in conjunction CacheProviders.

cache package provides decorators

fetch
store
clear

Use these to decorate handlers, all functionality is completely optional.

store happens at the end of the handler. Interacts with response to store the cache.

Handlers are auto sequenced.
http://stackoverflow.com/questions/6965021/how-do-i-implement-two-decorators-in-python-both-of-which-would-eventually-want-t

@BradMclain
Member

Implemented in r236 doesn't do @cache.store properly

@devraj
Member
devraj commented Jun 25, 2013

Support caching via using proper headers, http://www.mobify.com/blog/beginners-guide-to-http-cache-headers/

@devraj devraj modified the milestone: 2.1, 2.0 May 13, 2014
@devraj
Member
devraj commented May 13, 2014

Consider the effect of things like NDB cache

@BradMclain BradMclain modified the milestone: Future Dec 1, 2014
@devraj devraj modified the milestone: 2.1.0 Jan 18, 2015
@devraj
Member
devraj commented Jun 11, 2015

After extended discussions with @BradMclain caching is very specific to the application and the backend it employs. This might be outside the scope of a project like prestans and might be the real of caching for backends like NDB or using dogpile for relational databases.

Even if the the writable response could be cached, complex authorisation rules would require accessing the backend per request. This would negate a swift response from the handler.

At present this has been deferred to be in the realm of the server or database environment.

@devraj devraj added the invalid label Jun 11, 2015
@devraj devraj closed this Jun 11, 2015
@BradMclain BradMclain modified the milestone: 3.1.0, 2.0.9 Aug 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment