Changes between Version 12 and Version 13 of InstallationGuidelinesApacheModWSGI


Ignore:
Timestamp:
09/18/09 21:27:28 (15 years ago)
Author:
Fran Boon
Comment:

Example of GZip & Expires

Legend:

Unmodified
Added
Removed
Modified
  • InstallationGuidelinesApacheModWSGI

    v12 v13  
    1818apt-get install libapache2-mod-wsgi
    1919a2enmod rewrite
     20a2enmod deflate
     21a2enmod headers
     22a2enmod expires
    2023vim /etc/apache2/sites-available/web2py
    2124}}}
     
    5962}}}
    6063
    61 Optimise by using GZip & Expires
     64Optimise by using [http://httpd.apache.org/docs/2.2/mod/mod_deflate.html GZip] & [http://httpd.apache.org/docs/2.2/mod/mod_expires.html Expires]:
     65{{{
     66  ### static files do not need WSGI
     67  <LocationMatch "^(/[\w_]*/static/.*)">
     68    Order Allow,Deny
     69    Allow from all
     70
     71    SetOutputFilter DEFLATE
     72    BrowserMatch ^Mozilla/4 gzip-only-text/html
     73    BrowserMatch ^Mozilla/4\.0[678] no-gzip
     74    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
     75    SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
     76    Header append Vary User-Agent env=!dont-vary
     77
     78    ExpiresActive On
     79    ExpiresByType text/html "access plus 5 minutes"
     80    ExpiresByType text/css "access plus 1 week"
     81    ExpiresByType image/gif "access plus 1 week"
     82    ExpiresByType image/jpeg "access plus 1 week"
     83    ExpiresByType image/jpg "access plus 1 week"
     84    ExpiresByType image/png "access plus 1 week"
     85    ExpiresByType application/x-shockwave-flash "access plus 1 week"
     86  </LocationMatch>
     87}}}
    6288
    6389{{{