Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weierophinney opened this issue Dec 31, 2019 · 1 comment
Open

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

weierophinney opened this issue Dec 31, 2019 · 1 comment

Comments

@weierophinney
Copy link
Contributor

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.


Originally posted by @Wilt at zfcampus/zf-hal#117

@weierophinney
Copy link
Contributor Author

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.


Originally posted by @kevinpapst at zfcampus/zf-hal#117 (comment)

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

No branches or pull requests

1 participant