REST Controller: Built-in caching. #123
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
experiment
suggestion
support
Testing
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/framework#123
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This should be quite simple to implement. Basically, I will generate a key based on the endpoint, arguments and query string and cache the result. Then next time we get the same query we can just return it immediately. This should speed up and cut down on some processing, especially when external network/database requests are involved.
There will be two operating modes.
Caching by endpoint
This will involve a new phpdoc directive called
@cache
that takes a boolean parameter indicating if caching is enabled or not. If the default is to "cache everything" then setting this true will do nothing. Setting it to false will disable caching on this particular endpoint.Example
Cache Everything
This will involve an initialiser function called enableEndpointCaching(boolean). Setting this to true will enable caching on all endpoints by default. To disable caching for a single endpoint, use the above
@cache false
directive.created branch
123-rest-controller-built-in-caching
mentioned in merge request !36
closed via merge request !36
mentioned in commit b5c116e0c7ee97026a70a046346bfa3e0fd57260
changed milestone to %4