-
Notifications
You must be signed in to change notification settings - Fork 385
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
[BUG] Cache constantly updating #830
Comments
Same problem here. This is caused by these 4 occurrences of
Or at least the array index should be consistent everywhere... |
The default file cache is deprecated an will be removed in the next major release. Instead you should use a PSR-16 cache implementation like Symfony Cache or every other implementation. $simplepie = new \SimplePie\SimplePie();
$simplepie->set_cache(
new \Symfony\Component\Cache\Psr16Cache(
new \Symfony\Component\Cache\Adapter\FilesystemAdapter()
),
); |
Then, a simple example on how to then set the cache type (i.e. file), location and duration would be nice. |
The code example is from #777. Setting cache type and location is part of the PSR-16 implementation. The cache duration is still configured using |
I still don't see an example that one can easily copy/past and just fill in 2 or 3 parameters. |
Please take a look again at my comment above. It already shows you a working example using Symfony Cache using the FilesystemAdapter. But you are free to choose another adapter or even every other implementation.
You don't have to read the PSR-16 spec. You have to look at the more than 100 implementations (and the PSR-16 spec allows you to try and use them all). Choose the one that works best for you. No one knows your project and use case better than you do. |
The example above does not show how to define the (custom) cache file location. |
The file location in the FilesytemAdapter is not required, it uses I would like to avoid more complex examples for a specific library. Mentioning the Symfony cache implementation alone is already very opinionated. Using the filesystem adapter as cache type is also opinionated. If you would like to have a more customized example for this library in the docs you are welcome to open a PR. |
Looks good, please go ahead |
Description
It doesn't seem like the cache is working correctly for me. Every time I reload the page, I see the timestamps of the cache files update.
This shouldn't be the case, or?
Steps to Reproduce
Expected Behavior
Cache not updating every run.
Actual Behavior
Cache is updating on every run.
Possible Solutions
If you have already ideas how to solve the issue, add them here. (remove this section if not needed)
Environment
PHP 8.1
SimplePie 1.8.0
The text was updated successfully, but these errors were encountered: