Commits

Andriy Kornatskyy  committed 2d942b1

Updated sample nginx config with gzip settings and public cacheability for static content; updated static cache profile to include http vary by accept-encoding.

  • Participants
  • Parent commits 0f0d066

Comments (0)

Files changed (6)

File demos/quickstart-empty/etc/nginx.conf

     client_max_body_size 1k;
     error_page 502 /maintenance.html;
 
+    gzip on;
+    gzip_comp_level 6;
+    gzip_min_length 1024;
+    gzip_types application/json text/css application/x-javascript;
+    gzip_vary on;
+
     location / {
         uwsgi_pass backend;
         include uwsgi_params;
         alias  /usr/local/lib/mysite/current/content/static/;
         access_log off;
         expires 7d;
+        add_header Cache-Control public;
     }
 
     location /maintenance.html {

File demos/quickstart-empty/src/public/web/profile.py

     duration=timedelta(minutes=15),
     vary_environ=['HTTP_ACCEPT_ENCODING'],
     namespace='static',
+    http_vary=['Accept-Encoding'],
     enabled=config.getboolean('cache-profile', 'static-enabled'))
 public_cache_profile = CacheProfile(
     'server',

File demos/quickstart-i18n/etc/nginx.conf

     client_max_body_size 1k;
     error_page 502 /maintenance.html;
 
+    gzip on;
+    gzip_comp_level 6;
+    gzip_min_length 1024;
+    gzip_types application/json text/css application/x-javascript;
+    gzip_vary on;
+
     location / {
         uwsgi_pass backend;
         include uwsgi_params;
         alias  /usr/local/lib/mysite/current/content/static/;
         access_log off;
         expires 7d;
+        add_header Cache-Control public;
     }
 
     location /maintenance.html {

File demos/quickstart-i18n/src/public/web/profile.py

     duration=timedelta(minutes=15),
     vary_environ=['HTTP_ACCEPT_ENCODING'],
     namespace='static',
+    http_vary=['Accept-Encoding'],
     enabled=config.getboolean('cache-profile', 'static-enabled'))
 public_cache_profile = CacheProfile(
     'server',

File demos/template/etc/nginx.conf

     client_max_body_size 1k;
     error_page 502 /maintenance.html;
 
+    gzip on;
+    gzip_comp_level 6;
+    gzip_min_length 1024;
+    gzip_types application/json text/css application/x-javascript;
+    gzip_vary on;
+
     location / {
         uwsgi_pass backend;
         include uwsgi_params;
         alias  /usr/local/lib/mysite/current/content/static/;
         access_log off;
         expires 7d;
+        add_header Cache-Control public;
     }
 
     location /maintenance.html {

File demos/template/src/public/web/profile.py

     duration=timedelta(minutes=15),
     vary_environ=['HTTP_ACCEPT_ENCODING'],
     namespace='static',
+    http_vary=['Accept-Encoding'],
     enabled=config.getboolean('cache-profile', 'static-enabled'))
 public_cache_profile = CacheProfile(
     'both',