Use gzip compression wherever possible

This commit is contained in:
Noah 2017-05-08 17:31:11 +00:00
parent a83ad6506c
commit 2a3bb3bdef
3 changed files with 4 additions and 1 deletions

View File

@ -1,4 +1,5 @@
flask flask
flask-compress
flask-sslify flask-sslify
redis redis
pytz pytz

View File

@ -6,6 +6,7 @@ from __future__ import unicode_literals, absolute_import
from flask import (Flask, g, request, session, render_template, send_file, from flask import (Flask, g, request, session, render_template, send_file,
abort, redirect) abort, redirect)
from flask_sslify import SSLify from flask_sslify import SSLify
from flask_compress import Compress
import jinja2 import jinja2
import os.path import os.path
import datetime import datetime
@ -16,6 +17,7 @@ import sys
app = Flask(__name__, app = Flask(__name__,
static_url_path="/.static", static_url_path="/.static",
) )
Compress(app)
# We use a custom Jinja loader to support multiple template paths for custom # We use a custom Jinja loader to support multiple template paths for custom
# and default templates. The base list of template paths to check includes # and default templates. The base list of template paths to check includes

View File

@ -41,7 +41,7 @@
{{ post["rendered_body"] | safe }} {{ post["rendered_body"] | safe }}
{% if post["snipped"] %} {% if post["snipped"] %}
<p> <p>
<a href="{{ url_for('blog.entry', fid=post['fid']) }}">Read more...</a> <a href="{{ url_for('blog.entry', fid=post['fid']) }}#snip">Read more...</a>
{% endif %} {% endif %}
<p> <p>