-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
How to get the modification/creation time from a cache entry? #21275
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
Comments
Symfony Cache implements PSR-6, and PSR-6 does not provide any mean to get this date back. |
@nicolas-grekas at the beginning, Symfony Cache was a strict PSR-6 implementation ... but lately we added some features and we are not PSR-6 strict. So, maybe, if we consider this a useful feature, we could add it, right? |
@nicolas-grekas I was afraid so. Too bad because it would be really helpful. Thanks for taking your time to read my question! |
@javiereguiluz It seems really helpful, especially since Symfony already has a YAML decoder available. Let's say you have YAML config file that you want to cache, you would have no immediate way to rewrite to the cache after a file change to the YAML file without having the modification time. |
@javiereguiluz why not, but as in #19728, it'd be great to do this in coordination with others so that it ends up in the fig's hands. So, please open an RFC if you mind. |
Hi,
I have a question about using the symfony cache component in a project of mine.
I am using the YAML decoder to decode a YAML file of mine to a PHP array. In turn, this php array is being used as the value for a cache entry with the Symfony cache component.
It all works perfectly fine. The problem is that I need update the cache entry when my YAML file has been changed. To do this I need to get the last modification time from the cache entry and compare it to that of my YAML file.
Currently I don't see any method to get a creation of modification timestamp. I however do see a creation timestamp on my cache entry, similar to this:
Getting a modification time would be something that could prove extremely helpful. Is there any way to solve my problem with the current Symfony cache implemtation?
If I could get the absolute cache path from the cache item I could also get the modification time myself, but I also do not see any method for this.
The text was updated successfully, but these errors were encountered: