Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

App Engine - How to set "Vary: Accept-Encoding" header for static files

Google Page Speed says.

The following publicly cacheable, compressible resources should have a "Vary: Accept-Encoding" header:

for my css and js files.

How can I set google app engine to do this?

like image 979
Kyle Avatar asked Jul 02 '10 18:07

Kyle


2 Answers

From the docs, just add the http_headers for the handlers you need in app.yaml (for Python):

- url: /static
  static_dir: static
  http_headers:
    Vary: Accept-Encoding
like image 167
cprcrack Avatar answered Oct 22 '22 21:10

cprcrack


Google App Engine tries to serve compressed content when it can. So you shouldn't have to do anything as long as the client follows the guidelines at the link.

like image 2
Robby Pond Avatar answered Oct 22 '22 21:10

Robby Pond