From 2b9bfb47e560f3abf2eee6079f195b8352e8af30 Mon Sep 17 00:00:00 2001 From: pictuga Date: Tue, 31 May 2016 02:47:49 +0200 Subject: [PATCH] Remove :smart and etag headers Dirty code, not very useful. Use simple cache-control instead. --- morss/morss.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/morss/morss.py b/morss/morss.py index 08a3953..0a6ccd8 100644 --- a/morss/morss.py +++ b/morss/morss.py @@ -450,11 +450,6 @@ def Gather(rss, url, options): def Before(rss, options): for i, item in enumerate(list(rss.items)): - if options.smart and options.last: - if item.time < feeds.parse_time(options.last) and i > 2: - item.remove() - continue - if options.empty: item.remove() continue @@ -564,18 +559,9 @@ def cgi_app(environ, start_response): global DEBUG DEBUG = options.debug - if 'HTTP_IF_NONE_MATCH' in environ: - options['last'] = int(environ['HTTP_IF_NONE_MATCH'][1:-1]) - if not options.force and time.time() - options.last < DELAY: - headers['status'] = '304 Not Modified' - start_response(headers['status'], list(headers.items())) - log(url) - log('etag good') - return [] - # headers headers['status'] = '200 OK' - headers['etag'] = '"%s"' % int(time.time()) + headers['cache-control'] = 'max-age=%s' % DELAY if options.cors: headers['access-control-allow-origin'] = '*'