changeset 6375:692dddf298e2

middleware: drop gzipper middleware It added unfortunate buffering, was only enabled for static_files=true, and isn't available for TurboGears2. If necessary, it is better to configure the web server to provide it.
author Mads Kiilerich <mads@kiilerich.com>
date Tue, 03 Jan 2017 02:06:41 +0100
parents d02c715e2805
children dc94e662ee74
files docs/usage/performance.rst kallithea/config/middleware.py
diffstat 2 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/docs/usage/performance.rst	Tue Jan 03 02:06:41 2017 +0100
+++ b/docs/usage/performance.rst	Tue Jan 03 02:06:41 2017 +0100
@@ -81,14 +81,13 @@
 -----------------------------------------------
 
 With the default ``static_files`` ini setting, the Kallithea WSGI application
-will take care of serving the static files found in ``kallithea/public`` from
-the root of the application URL. While doing that, it will currently also
-apply buffering and compression of all the responses it is serving.
+will take care of serving the static files from ``kallithea/public/`` at the
+root of the application URL.
 
-The actual serving of the static files is unlikely to be a problem in a
-Kallithea setup. The buffering of responses is more likely to be a problem;
-large responses (clones or pulls) will have to be fully processed and spooled
-to disk or memory before the client will see any response.
+The actual serving of the static files is very fast and unlikely to be a
+problem in a Kallithea setup - the responses generated by Kallithea from
+database and repository content will take significantly more time and
+resources.
 
 To serve static files from the web server, use something like this Apache config
 snippet::
@@ -104,9 +103,16 @@
         static_files = false
 
 If using Kallithea installed as a package, you should be able to find the files
-under site-packages/kallithea, either in your Python installation or in your
+under ``site-packages/kallithea``, either in your Python installation or in your
 virtualenv. When upgrading, make sure to update the web server configuration
 too if necessary.
 
+It might also be possible to improve performance by configuring the web server
+to compress responses (served from static files or generated by Kallithea) when
+serving them. That might also imply buffering of responses - that is more
+likely to be a problem; large responses (clones or pulls) will have to be fully
+processed and spooled to disk or memory before the client will see any
+response. See the documentation for your web server.
+
 
 .. _SQLAlchemyGrate: https://github.com/shazow/sqlalchemygrate
--- a/kallithea/config/middleware.py	Tue Jan 03 02:06:41 2017 +0100
+++ b/kallithea/config/middleware.py	Tue Jan 03 02:06:41 2017 +0100
@@ -20,7 +20,6 @@
 from paste.registry import RegistryManager
 from paste.urlparser import StaticURLParser
 from paste.deploy.converters import asbool
-from paste.gzipper import make_gzip_middleware
 
 from pylons.middleware import ErrorHandler, StatusCodeRedirect
 from pylons.wsgiapp import PylonsApp
@@ -105,7 +104,6 @@
         # Serve static files
         static_app = StaticURLParser(config['pylons.paths']['static_files'])
         app = Cascade([static_app, app])
-        app = make_gzip_middleware(app, global_conf, compress_level=1)
 
     app.config = config