pngtile.cache: set last_modified/cache-control in 304 response as well..
authorTero Marttila <terom@qmsk.net>
Sat, 04 Oct 2014 03:03:17 +0300
changeset 174 58c9e2de0dd4
parent 173 e7822b0be417
child 175 16ab69a5569a
pngtile.cache: set last_modified/cache-control in 304 response as well..
pngtile/tile.py
--- a/pngtile/tile.py	Sat Oct 04 02:46:44 2014 +0300
+++ b/pngtile/tile.py	Sat Oct 04 03:03:17 2014 +0300
@@ -170,13 +170,14 @@
             ttime = None
 
         if request.if_modified_since and mtime == request.if_modified_since:
-            return Response(status=304)
-            
-        # render
-        png = render_func(request, image)
+            response = Response(status=304)
+        else:
+            # render 
+            png = render_func(request, image)
         
-        # response
-        response = Response(png, content_type='image/png')
+            response = Response(png, content_type='image/png')
+        
+        # cache out
         response.last_modified = mtime
 
         if not ttime: