From 7b7a1d8dfd039bb40d0c48c8bcf8f14d81612ec7 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Fri, 17 Jan 2014 04:32:08 +0600 Subject: [PATCH] Make Filesystem storage backend default again. See GH-500. --- docs/topics/downloader-middleware.rst | 41 +++++++++++++-------------- scrapy/settings/default_settings.py | 2 +- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/docs/topics/downloader-middleware.rst b/docs/topics/downloader-middleware.rst index cf963e7ae..078e08453 100644 --- a/docs/topics/downloader-middleware.rst +++ b/docs/topics/downloader-middleware.rst @@ -307,8 +307,8 @@ HttpCacheMiddleware Scrapy ships with two HTTP cache storage backends: - * :ref:`httpcache-storage-dbm` * :ref:`httpcache-storage-fs` + * :ref:`httpcache-storage-dbm` You can change the HTTP cache storage backend with the :setting:`HTTPCACHE_STORAGE` setting. Or you can also implement your own storage backend. @@ -376,29 +376,12 @@ In order to use this policy, set: * :setting:`HTTPCACHE_POLICY` to ``scrapy.contrib.httpcache.RFC2616Policy`` -.. _httpcache-storage-dbm: - -DBM storage backend (default) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 0.13 - -A DBM_ storage backend is available for the HTTP cache middleware. - -By default, it uses the anydbm_ module, but you can change it with the -:setting:`HTTPCACHE_DBM_MODULE` setting. - -In order to use this storage backend, set: - -* :setting:`HTTPCACHE_STORAGE` to ``scrapy.contrib.httpcache.DbmCacheStorage`` - - .. _httpcache-storage-fs: -Filesystem storage backend -~~~~~~~~~~~~~~~~~~~~~~~~~~ +Filesystem storage backend (default) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -A file system storage backend is also available for the HTTP cache middleware. +File system storage backend is available for the HTTP cache middleware. In order to use this storage backend, set: @@ -423,6 +406,22 @@ inefficient in many file systems). An example directory could be:: /path/to/cache/dir/example.com/72/72811f648e718090f041317756c03adb0ada46c7 +.. _httpcache-storage-dbm: + +DBM storage backend +~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 0.13 + +A DBM_ storage backend is also available for the HTTP cache middleware. + +By default, it uses the anydbm_ module, but you can change it with the +:setting:`HTTPCACHE_DBM_MODULE` setting. + +In order to use this storage backend, set: + +* :setting:`HTTPCACHE_STORAGE` to ``scrapy.contrib.httpcache.DbmCacheStorage`` + HTTPCache middleware settings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scrapy/settings/default_settings.py b/scrapy/settings/default_settings.py index b3736ce9e..8acca0928 100644 --- a/scrapy/settings/default_settings.py +++ b/scrapy/settings/default_settings.py @@ -145,7 +145,7 @@ FEED_EXPORTERS_BASE = { HTTPCACHE_ENABLED = False HTTPCACHE_DIR = 'httpcache' HTTPCACHE_IGNORE_MISSING = False -HTTPCACHE_STORAGE = 'scrapy.contrib.httpcache.DbmCacheStorage' +HTTPCACHE_STORAGE = 'scrapy.contrib.httpcache.FilesystemCacheStorage' HTTPCACHE_EXPIRATION_SECS = 0 HTTPCACHE_IGNORE_HTTP_CODES = [] HTTPCACHE_IGNORE_SCHEMES = ['file']