Skip to content

Distinct cache for force_feed#643

Merged
mblaney merged 3 commits intosimplepie:masterfrom
FreshRSS:distinct_cache_for_force_feed
Mar 30, 2020
Merged

Distinct cache for force_feed#643
mblaney merged 3 commits intosimplepie:masterfrom
FreshRSS:distinct_cache_for_force_feed

Conversation

@Alkarex
Copy link
Contributor

@Alkarex Alkarex commented Mar 28, 2020

Ensure that feeds retrieved with the force_feed option do not share the
same cache than feeds retrieved without this option.
Otherwise, in a context with multiple clients, clients without the
force_feed option would have a behaviour (working or not) depending
entirely on what other clients with force_feed are doing. In other
words, it produces a side-effect difficult to predict, which should be
avoided.

Ensure that feeds retrieved with the force_feed option do not share the
same cache than feeds retrieved without this option.
Otherwise, in a context with multiple clients, clients without the
force_feed option would have a behaviour (working or not) depending
entirely on what other clients with force_feed are doing. In other
words, it procudes a side-effect difficult to predict, which should be
avoided.
@Alkarex
Copy link
Contributor Author

Alkarex commented Mar 28, 2020

P.S. Tested using the default cache system

@Alkarex
Copy link
Contributor Author

Alkarex commented Mar 28, 2020

Travis is successful, but apparently the status on GitHub has not received the notification

Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Mar 28, 2020
#fix #2524
In general, we should avoid using the same cache for feeds that are fetched with distinct parameters / settings..
PR upstream to SimplePie simplepie/simplepie#643
@mblaney
Copy link
Member

mblaney commented Mar 29, 2020

thanks @Alkarex looks like a good idea. you don't need the check in fetch_data() though because you're already in the block if (!$this->force_feed)

@Alkarex
Copy link
Contributor Author

Alkarex commented Mar 29, 2020

Here you are @mblaney

@mblaney
Copy link
Member

mblaney commented Mar 30, 2020

you don't need to modify fetch_data()at all.

@Alkarex
Copy link
Contributor Author

Alkarex commented Mar 30, 2020

Ah, sorry, it is indeed a if (!force_feed) {} block and not a if (force_feed) {} ...
(Amusingly, it was precisely to avoid such errors that I initially kept the same exact syntax for both cases)
Fixed

@mblaney mblaney merged commit aaad78e into simplepie:master Mar 30, 2020
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request Apr 1, 2020
Alkarex added a commit to FreshRSS/FreshRSS that referenced this pull request Apr 1, 2020
@Alkarex Alkarex deleted the distinct_cache_for_force_feed branch October 3, 2020 12:45
Alkarex added a commit to FreshRSS/simplepie that referenced this pull request Mar 28, 2021
Retrieving a feed with distinct cURL parameters such as user-agent might give different responses, which should not share the same cache.

Follow-up and generalisation of simplepie#643

The code to get the cache filename is extracted in its own new fuction `SimplePie::get_cache_filename($url)` so that clients can easily get this information as well.

Downstream PR: FreshRSS/FreshRSS#3502
@Alkarex Alkarex mentioned this pull request Mar 28, 2021
mblaney pushed a commit that referenced this pull request Apr 12, 2021
Retrieving a feed with distinct cURL parameters such as user-agent might give different responses, which should not share the same cache.

Follow-up and generalisation of #643

The code to get the cache filename is extracted in its own new fuction `SimplePie::get_cache_filename($url)` so that clients can easily get this information as well.

Downstream PR: FreshRSS/FreshRSS#3502
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants