Open mfairchild365 opened 9 years ago
@tsteiner what would it take to get these issues addressed? It seems fairly easy, but I'm not sure how easy it would be with the current architecture.
Silly nginx: when you turn on gzip, it only compresses text/html content. I've told it to compress everything now.
gzip_types *;
Applied on http://unlcms-dr.autosplit.its-sys.unl.edu/. If everything looks ok, I'll do an RFC and get it on production.
Sweet. Thank you @tsteiner
Do these changes also include browser caching of resources, or just gzip?
How long do you want wdn files cached?
7 days? Do @ericras or @kabel have any thoughts?
Would it be possible to coincide the cache expiration with a regular release timeline or RFC process?
I like @saltybeagle's idea, but I don't know if it is practical in a server configuration. Optimally, 1M
(month) would provide long life, but cache busting is probably always going to be an issue until we version our file names better.
The HTML5 Boilerplate comes with a wealth of good server configuration options.
@kabel are you suggesting not caching until we resolve the issue or only caching for a short time (~1 day)?
No, I would think that one month (our release cycle) is just fine.
Yes, good enough.
We've gotta start somewhere and I don't know enough about the varnish/nginx combo to know if we're shooting ourselves in the foot when it comes to cache busting.
Config updated on http://unlcms-dr.autosplit.its-sys.unl.edu/ . Let me know if/when to set up an RFC to push to production.
This appears to be working for me using curl, but not when changing my /etc/hosts
file. I tested in two ways:
1: using curl:
curl -IH 'Host: www.unl.edu' -H 'Accept-Encoding: gzip' http://unlcms-dr.autosplit.its-sys.unl.edu/wdn/templates_4.0/css/all.css?dep=4.0.27
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 26 May 2015 14:14:13 GMT
Content-Type: text/css
Last-Modified: Tue, 26 May 2015 07:30:33 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Cache-Control: public, max-age=2592000
Content-Encoding: gzip
X-Cacheable: Yes
X-Varnish: 426163 360495
Age: 267
Via: 1.1 varnish-v4
Content-Length: 49561
Connection: keep-alive
2: changing my /etc/hosts
file. This didn't result in assets being gziped or cached when viewing in a browser. Any idea why?
This is what I added to my hosts file
23.253.150.112 www.unl.edu
23.253.150.112 unlcms.unl.edu
I'm not sure. I made the same changes to my hosts file and everything worked as expected:
curl -I --compressed http://unlcms.unl.edu/wdn/templates_4.0/css/all.css?dep=4.0.27
HTTP/1.1 200 OK
Server: nginx
Date: Tue, 26 May 2015 14:30:34 GMT
Content-Type: text/css
Last-Modified: Tue, 26 May 2015 07:30:33 GMT
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Cache-Control: public, max-age=2592000
Content-Encoding: gzip
X-Cacheable: Yes
X-Varnish: 557109
Age: 0
Via: 1.1 varnish-v4
Connection: keep-alive
Works for me too, albeit, not with the IPs you had in your host file as those appear to be the production IPs.
host 23.253.150.112
112.150.253.23.in-addr.arpa domain name pointer unlcms-dr-web-node-alpha.iad.rackspace.its-sys.unl.edu.
Looks like a DR server to me
Ah, good point, read right over those extra letters. :facepunch:
I blame my browser, it appears to be working now.
However, I did notice that curl -I --compressed http://www.unl.edu/splash/
isn't being gzipped, but curl -I --compressed http://unlcms.unl.edu/
is.
Varnish is now setup to compress any uncompressed content of MIME type text/* (on the DR servers)
see https://developers.google.com/speed/pagespeed/insights/?url=http%3A%2F%2Fwdn.unl.edu%2F&tab=mobile
This is currently an issue for many framework provided assets and should be fixed.