-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
[Laravel] Caching strategy and warm up #6735
Comments
Nevermind, cache warm up seems to happen anyway when registering routes...using the laravel conf for cache provider would still be great, in case some might want to use memory caching like apcu instead of file caches |
Indeed we didn't thought it'd need to be documented. In symfony we rely on the 👍 to use the |
@soyuka |
In my PR above, I'm using Laravel's cache and also setting the default cache driver to null for workbench tests |
Make use of the default laravel cache setting, makes it possible for developers to configure where data should be cached Closes: api-platform#6735 Signed-off-by: Tobias Oitzinger <[email protected]>
Make use of the default laravel cache setting, makes it possible for developers to configure where data should be cached Closes: api-platform#6735 Signed-off-by: Tobias Oitzinger <[email protected]>
Make use of the default laravel cache setting, makes it possible for developers to configure where data should be cached Closes: api-platform#6735 Signed-off-by: Tobias Oitzinger <[email protected]>
Make use of the default laravel cache setting, makes it possible for developers to configure where data should be cached Closes: api-platform#6735 Signed-off-by: Tobias Oitzinger <[email protected]>
Closed with #6751 |
Description
While running into performance issues on my machine with requests taking up to seconds, i noticed that API Platform decides between 2 cache methods (array/file) based on the APP_DEBUG setting which was quite confusing. I get that the default value for using laravels cache setting
CACHE_STORE
isfile
and that in development instances you wouldn't wanna cache at all. So i can also see why you would check for another .env setting (like DEBUG). However i couldn't find that in the documentation (maybe i missed it). So i'd like to propose the following changes:Document that the
DEBUG
setting changes the caching strategy for api platform (or switch to a config setting or toENVIRONMENT
(production/local) setting or whatever - altough i would prefer something like using theENVIRONMENT
setting, ultimately i think it does not really matter as long as it is in the docs)Reagardless of the Above, keep
array
in "debug" cases but use theCACHE_STORE
setting which comes with laravel for production e.g non debug. It defaults to file anyway and allows more control with no overhead.Since that cache is stored "forever" when it is first accessed (Metadata etc.. does not change on production environments), it could be cool/useful to hook into the Optimze command of laravel (described here) and "warm up" the cache with that data. I think that would be pretty neat.
Let me know what you think about that, i will happily submit a PR :)
The text was updated successfully, but these errors were encountered: