Closed instanceofme closed 13 years ago
Making it work for the _default
cache would be painstaking (would require the implementation of the timeout clearing).
My suggestion would be to leave it as is, since it seems to me that explicitly specifying memory
as cache type will make use of amplify.store.memory
, and thus benefit from the override
behavior.
This breaks the separation of logic. The requestor isn't allowed to know that the data is cached. See http://groups.google.com/group/amplifyjs/browse_thread/thread/bc0794907fe9d64d for a related discussion.
Pass an
override: true
property in thecache
setting, and it will perform the ajax request and replace an existing cache.Example:
Useful when you perform an action that you know modifies the result of a previously-cached request.
Use case 1: I'm listing a node in a tree. I request the content of the current node, caching the result for 5 minutes. I have a "create node" button that will create a new node inside the current node. Any request for the current node won't show the newly created node until the end of the 5 minutes caching period.
Use case 2: refresh button.