diff piecrust/rendering.py @ 49:fce061f8c2ed

Fix cache validation issue with rendered segments, limit disk access.
author Ludovic Chabant <ludovic@chabant.com>
date Fri, 22 Aug 2014 20:26:05 -0700
parents 65ae19c4e8a3
children 2fec3ee1298f
line wrap: on
line diff
--- a/piecrust/rendering.py	Fri Aug 22 20:25:41 2014 -0700
+++ b/piecrust/rendering.py	Fri Aug 22 20:26:05 2014 -0700
@@ -90,8 +90,10 @@
         repo = ctx.app.env.rendered_segments_repository
         if repo:
             cache_key = '%s:%s' % (ctx.uri, ctx.page_num)
+            page_time = page.path_mtime
             contents = repo.get(cache_key,
-                    lambda: _do_render_page_segments(page, page_data))
+                    lambda: _do_render_page_segments(page, page_data),
+                    fs_cache_time=page_time)
         else:
             contents = _do_render_page_segments(page, page_data)