Permalink
Browse files

httpcache: don't store already cached response.

  • Loading branch information...
1 parent f2966ee commit 503fdf39fe6417436a675de09cfac9f2c4114194 @rolando rolando committed Dec 30, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 scrapy/contrib/downloadermiddleware/httpcache.py
@@ -52,7 +52,9 @@ def process_request(self, request, spider):
raise IgnoreRequest("Ignored request not in cache: %s" % request)
def process_response(self, request, response, spider):
- if self.is_cacheable(request) and self.is_cacheable_response(response):
+ if (self.is_cacheable(request)
+ and self.is_cacheable_response(response)
+ and 'cached' not in response.flags):
self.storage.store_response(spider, request, response)
stats.inc_value('httpcache/store', spider=spider)
return response

0 comments on commit 503fdf3

Please sign in to comment.