зеркало из https://github.com/mozilla/bedrock.git
tweaks to 404 page and caching
This commit is contained in:
Родитель
26032ee99b
Коммит
a5a2391a07
|
@ -5,7 +5,10 @@ from time import mktime
|
|||
class CacheMiddleware(object):
|
||||
|
||||
def process_response(self, request, response):
|
||||
if response.status_code != 404 and 'Cache-Control' not in response:
|
||||
cache = (request.method != 'POST' and
|
||||
response.status_code != 404 and
|
||||
'Cache-Control' not in response)
|
||||
if cache:
|
||||
d = datetime.datetime.now() + datetime.timedelta(minutes=10)
|
||||
stamp = mktime(d.timetuple())
|
||||
|
||||
|
|
|
@ -1 +1,8 @@
|
|||
Page Not Found - mozilla.org
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<div id="main-content">
|
||||
<h1>Whoops!</h1>
|
||||
We apologize, but this page cannot be found.
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче