# HG changeset patch # User Tero Marttila # Date 1412380997 -10800 # Node ID 58c9e2de0dd47c41ca29e3bdd9f803c7eb0cdb61 # Parent e7822b0be417e95e9505d7d5975d0fc7166dad5b pngtile.cache: set last_modified/cache-control in 304 response as well.. diff -r e7822b0be417 -r 58c9e2de0dd4 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: