Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Support for read-only resources that are loaded from cache #117

Open
Wilt opened this issue Aug 26, 2015 · 2 comments
Open

Support for read-only resources that are loaded from cache #117

Wilt opened this issue Aug 26, 2015 · 2 comments

Comments

@Wilt
Copy link
Contributor

Wilt commented Aug 26, 2015

We have quite some resources in our application that are read-only. Those resources will render the same for each request which means once the hal/json response is rendered it could simply be stored in a cache and on the next request we skip a lot of overhead by returning the cached hal/json.

I could imagine a read-only field in the controller config which defaults to false and a cache service in the Hal plugin to support such functionality.

Is there any interest in a pull request for something like this for read-only resources.

@kevinpapst
Copy link

I would be interested in seeing your solution. If done something similar, a ZF2 module that is listens for MvcEvents, can read&write to a Cache service and works with GET requests only on routes including .rest. in their name.

I ran into a bug when reinjecting the modul from cache into the response (as described in #134) which I could not solve yet. As we use mostly plain JSON and not a HAL representation its not a show stopper, but if you find a way around that issue, I would be happy to see/test it and share some ideas.

But I'am not sure that zf-hal is the right place for this. Caching should be implemented as a standalone module IMO.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-hal; a new issue has been opened at laminas-api-tools/api-tools-hal#17.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants