Closed
Conversation
For feeds that do not support HTTP conditional requests, makes a MD5 hash to detect changes. To do that, some cleaning is needed, e.g. removing comments such as `<!-- Generated on XX -->`, or `<lastBuildDate>` which may be changing even when no actual content has changed. FreshRSS/FreshRSS@9aab83a Take also care of the caching of feeds with errors. Before the cache system was not used for feeds with errors; there was no protection against repetitive refresh. FreshRSS/FreshRSS@00127f0 Used in production in FreshRSS
Alkarex
referenced
this pull request
in FreshRSS/FreshRSS
Apr 6, 2015
Contribue à #351 (comment) Pour les flux qui ne supportent pas les requêtes conditionnelles. Filtre les tags et commentaires gênants avant la signature (style <lastBuildDate> qui change tout le temps sans que le contenu change, <slash:comments>, ainsi que les commentaires XML qui détruisent le cache comme <!-- généré en X secondes -->) Il reste quelques flux à débogger dont le cache n'est pas encore optimal. C'est pour cela qu'il reste quelques syslog(LOG_DEBUG, ...). Au passage, évite que SimplePie fasse une double requête pour vérifier le cache si le serveur est un peu lent. Un jour, il faudra nettoyer les changements faits à SimplePie et leur remonter les patchs les plus intéressants.
Alkarex
referenced
this pull request
in FreshRSS/FreshRSS
Apr 6, 2015
Before the cache system was not used for feeds with errors, which was problematic especially if several users have this feed. Furthermore, there was no protection against repetitive refresh. Bonus: slightly better performance by avoiding some superfluous file_exists(). Warning: needs a bit of testing #681
This was referenced Apr 6, 2015
Alkarex
added a commit
to Alkarex/simplepie
that referenced
this pull request
Jul 11, 2015
Conflicts: library/SimplePie.php simplepie#359 nerzhul@f35dbcc simplepie#401 FreshRSS/FreshRSS@9aab83a
Member
|
Hi @Alkarex, I don't like the idea of changing the init() signature, you could expose mtime with a member variable if you want access to it. |
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this pull request
Jun 18, 2024
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this pull request
Jun 23, 2024
This was referenced Jun 23, 2024
Closed
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this pull request
Aug 17, 2024
Alkarex
added a commit
to FreshRSS/simplepie
that referenced
this pull request
Sep 8, 2024
* Hash-based caching simplepie#401 FreshRSS/FreshRSS@9aab83a FreshRSS/FreshRSS@00127f0 * Backport fix FreshRSS/FreshRSS#6723 * A few fixes * Reduce changes * Reduce changes * Relax some tests * Fix comment * Fix a few tests * PHP 7.2 compatibility * Behaviour fixes * Simplification * Comment * Fix tests * Remove debug logs * Minor comment * Fix type mess with $this->data['headers']
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch may not be suited to be merged as-is in SimplePie, but it is used in FreshRSS since February 2014, and may contribute to a discussion/process of improving HTTP caching in SimplePie. It is a part of the process of proposing/reporting upstream the changes made to SimplePie in FreshRSS
Introduces
data['mtime']anddata['md5'].For feeds that do not support HTTP conditional requests, makes a MD5 hash to detect changes.
To do that, some cleaning is needed, e.g. removing comments such as
<!-- Generated on XX -->, or<lastBuildDate>which may be changing even when no actual content has changed.FreshRSS/FreshRSS@9aab83a
SimplePie::init() now returns a positive integer with modification time if using cache, boolean true if otherwise successful, false otherwise.
Take also care of the caching of feeds with errors. Before, the cache system was not used for feeds with errors; there was no protection against repetitive refresh.
FreshRSS/FreshRSS@00127f0