javascript - How to add expiration headers to Meteor static assets -
is possible add expiration headers static assets in meteor? or way configure them?
thanks!
for use on production recommended have nginx proxy between client , meteor server.
so best way add caching headers files static directory add them in nginx config.
just take meteor nginx config 1 david weldon made: gist
then add following location:
location /static { proxy_pass http://localhost:3000/static; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; proxy_set_header host $host; expires 365d; gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/plain application/x-javascript text/xml text/css; gzip_vary on; }
as bonus added gzip, if not need remove gzip stuff.
if want make more advanced have nginx make cache of static files retrieved meteor.
this way meteor receive static request once every static file, after nginx serve them it's own cache decreasing load on meteor instance.
which this: gist
some sources setting nginx proxy in font of meteor: gentlenode.com meteorpedia stackoverflow
Comments
Post a Comment