Commits

Ivan Melnikov committed e8b21c7 Draft

Fix cache logic, add favicon

Comments (0)

Files changed (3)

 	key = CACHE_PAGE + path
 	page = memcache.get(key)
 	if page is None:
+		log.info('Load page from DB')
 		found = Page.all().filter('path', path).fetch(1)
 		if found:
 			page = found[0]
 def get_files(page):
 	key = CACHE_FILES + page.path
 	files = memcache.get(key)
-	if not files:
+	if files is None:
+		log.info('load files from DB')
 		files = page.files.fetch(1000)
 		memcache.set(key, files)
 	return files

template/page/index.html

 <!DOCTYPE html>
 <html>
 <head>
+	<link rel="icon" type="image/png" href="/_static/img/favicon.png">
 	<link rel="stylesheet" type="text/css" href="/_static/css/page.css">
 	<link rel="stylesheet" type="text/css" href="/_static/css/wiki.css">
 	<script type="text/javascript" charset="utf-8" src="/_static/js/page.js"></script>
 	<script src="/_static/js/jquery.js"></script>
+	{% block head %} {% endblock %}
 </head>
 <body>
 <div class="page-content">

template/static/img/favicon.png

Added
New image