diff options
author | Tzafrir Cohen <tzafrir@cohens.org.il> | 2017-11-25 17:33:07 +0200 |
---|---|---|
committer | Tzafrir Cohen <tzafrir@cohens.org.il> | 2017-11-25 17:41:02 +0200 |
commit | 95e9a704a9feef853dfb31eaa1482e33e8844ca9 (patch) | |
tree | 76f0c8e1b7996d575b4d648715eff4830794b75e | |
parent | 06124b67777c912ef80be4ed352fe66a1f3233e9 (diff) |
remove caching of downloaded HTML pages
Simplecache seems to be horribly slow, and is a point of contention
for multithreaded downloaders (in future commit).
Leave it only for the kodi page data: this really saves work.
-rw-r--r-- | default.py | 7 |
1 files changed, 0 insertions, 7 deletions
@@ -80,18 +80,11 @@ class Page: def read_url(url): - cache_id = PLUGIN_NAME + '.url.' + url - cached_read = SiteCache.get(cache_id) - if cached_read: - return cached_read - headers = {'user-agent': USER_AGENT} response = requests.get(url, headers=headers) if response.status_code != 200: raise IOError("Invalid URL {}".format(url)) - SiteCache.set(cache_id, response.content, - expiration=datetime.timedelta(days=1)) return response.text |