~libravatar/libravatar/master

« back to all changes in this revision

Viewing changes to config/www.apache2.conf

  • Committer: Francois Marier
  • Date: 2011-05-26 11:43:11 UTC
  • Revision ID: git-v1:1745d3c2d975c30525651559d1f0e20e38878fc7
Move js and css to -www and split images between -www and -cdn-common

Javascript and CSS files should be tied to the web application version
and not depend on mirrors to be up to date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
        ExpiresByType text/xml "access plus 1 seconds"
11
11
        ExpiresByType text/plain "access plus 1 week"
12
12
        ExpiresByType image/x-icon "access plus 1 week"
13
 
        # Uploaded/cropped images never change
14
 
        ExpiresByType image/jpeg "access plus 1 year"
15
 
        ExpiresByType image/png "access plus 1 year"
 
13
        ExpiresByType text/javascript "access plus 1 week"
 
14
        ExpiresByType text/css "access plus 1 week"
 
15
        ExpiresByType image/jpeg "access plus 1 week"
 
16
        ExpiresByType image/png "access plus 1 week"
16
17
    </IfModule>
17
18
 
18
19
    # For extra safety, whitelist paths to be served and deny the rest
33
34
        Allow from all
34
35
        Options +Indexes
35
36
    </Directory>
 
37
    <Directory /usr/share/libravatar/static>
 
38
        Allow from all
 
39
    </Directory>
36
40
    <Directory /etc/libravatar>
37
41
        <Files django.wsgi>
38
42
            Allow from all
48
52
        Allow from all
49
53
    </Directory>
50
54
 
 
55
    # Take advantage of precompressed files when they exist
 
56
    <Directory /usr/share/libravatar/static/css>
 
57
        AddEncoding gzip gz
 
58
        ForceType text/css
 
59
        Options +Multiviews
 
60
        SetEnv force-no-vary
 
61
        Header append Cache-Control "private"
 
62
    </Directory>
 
63
    <Directory /usr/share/libravatar/static/js>
 
64
        AddEncoding gzip gz
 
65
        ForceType text/javascript
 
66
        Options +Multiviews
 
67
        SetEnv force-no-vary
 
68
        Header append Cache-Control "private"
 
69
    </Directory>
 
70
 
 
71
    Alias /css /usr/share/libravatar/static/css
 
72
    Alias /js /usr/share/libravatar/static/js
 
73
    Alias /img /usr/share/libravatar/static/img
51
74
    Alias /favicon.ico /usr/share/libravatar/libravatar/favicon.ico
52
75
    Alias /robots.txt /usr/share/libravatar/libravatar/robots.txt
53
76
    Alias /uploaded /var/lib/libravatar/uploaded
57
80
 
58
81
    <Location /uploaded>
59
82
        Header set Cache-Control "public"
 
83
        # Uploaded/cropped images never change
 
84
        ExpiresByType image/jpeg "access plus 1 year"
 
85
        ExpiresByType image/png "access plus 1 year"
60
86
    </Location>
61
87
 
62
88
    <Location /user>
63
89
        Header set Cache-Control "public"
64
 
        ErrorDocument 404 http://__CDNSERVERNAME__/img/missing.png
 
90
        ErrorDocument 404 /img/missing.png
 
91
        # Uploaded/cropped images never change
 
92
        ExpiresByType image/jpeg "access plus 1 year"
 
93
        ExpiresByType image/png "access plus 1 year"
65
94
    </Location>
66
95
 
67
96
    <Location /export>