Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem: FeedsHTTPFetcherResult should cache the result of the HTTP request to not issue duplicated HTTP requests during the parsing phase. I'm importing 1500 items and during different queue API runs the result will be request again although the feed has not been completely imported yet. In my case FeedsXPathParserXML needs to get the raw result, and that causes a new HTTP request.
Solution: cache the result of the HTTP request in getRaw().
Comment | File | Size | Author |
---|---|---|---|
#8 | feeds-http-cache-2192819-8.patch | 1.77 KB | twistor |
#6 | feeds-http-cache-2192819-5.patch | 1.81 KB | twistor |
#5 | feeds-http-fetcher-auto-scheme-2046335-5.patch | 5.88 KB | twistor |
#3 | feeds-http-cache-2192819-3.patch | 1.66 KB | twistor |
#1 | feeds-http-cache-2192819-1.patch | 1.23 KB | klausi |
Comments
Comment #1
klausiPatch attached.
Comment #2
twistor CreditAttribution: twistor commentedSorry, the title threw me a bit, since we are caching the result. I guess what's happening is that your feed source doesn't use etags are last-modified. I wonder if this will allow us to get rid of the static cache in http_request_get()?
Comment #3
twistor CreditAttribution: twistor commentedKeeping that in memory isn't really ideal, but we do it already multiple times, and that all needs to be seriously fixed.
I'm going to say this is a bug, because other weird things can happen if you're re-downloading something in-between cron runs.
Only real change is to use !isset() instead of empty() so that an empty response body isn't fetched more than once.
Comment #5
twistor CreditAttribution: twistor commentedThat makes sense.
Comment #6
twistor CreditAttribution: twistor commentedEntirely wrong patch.
Comment #8
twistor CreditAttribution: twistor commentedThere's no reason to call parent::__construct() at all.
Comment #9
twistor CreditAttribution: twistor commentedThis is eligible for backport.
http://drupalcode.org/project/feeds.git/commit/a8468ac
Comment #10
twistor CreditAttribution: twistor as a volunteer commented