We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
nginx wordpress js with gzip?
Re: nginx wordpress js with gzip?
no didnt work either, and made sure I restarted the nginx service.SS88 wrote:If you add it directly in server { }
/home/<USER>/conf/web/nginx.conf like so:
Does that work!?Code: Select all
server { listen blah; server_name blah; root /home/blah/web/blah/public_html gzip on; gzip_disable "msie6"; gzip_comp_level 6; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/js text/javascript application/javascript application/x-javascript; }
Re: nginx wordpress js with gzip?
mime.types should be added like so (example only):hcjsy wrote:nginx: [warn] duplicate extension "js", content type: "application/x-javascript", previous content type: "application/javascript" in /etc/nginx/mime.types:9
nginx: [warn] duplicate extension "js", content type: "application/x-javascript", previous content type: "application/javascript" in /etc/nginx/mime.types:9
Code: Select all
image/jpeg jpeg jpg;
application/javascript text/javascript application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
Re: nginx wordpress js with gzip?
have adjusted the mime.types so that duplicate message is gone, and added the
thanks for finding that, but didnt work :(
the server is ubuntu 14
Code: Select all
gzip_http_version 1.0;
the server is ubuntu 14
Re: nginx wordpress js with gzip?
Code: Select all
root@pool:~# curl -H "Accept-Encoding: gzip" -I http://wordpress.highlands.ac.uk/wp-includes/js/wp-embed.min.js
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 1403
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Date: Wed, 08 Jun 2016 12:47:12 GMT
Content-Type: application/javascript
ETag: "57569748-57b"
Server: nginx
Accept-Ranges: bytes
Last-Modified: Tue, 07 Jun 2016 09:43:36 GMT
Vary: Accept-Encoding
Cache-Control: max-age=315360000
Re: nginx wordpress js with gzip?
What do you mean by not sending the header?
I ran the command here and :
I ran the command here and :
Code: Select all
root@oo:~# curl -H "Accept-Encoding: gzip" -I http://wordpress.highlands.ac.uk/wp-includes/js/wp-embed.min.js
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 08 Jun 2016 12:50:48 GMT
Content-Type: application/javascript
Last-Modified: Tue, 07 Jun 2016 09:43:36 GMT
Connection: keep-alive
Keep-Alive: timeout=60
Vary: Accept-Encoding
ETag: W/"57569748-57b"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Content-Encoding: gzip
Re: nginx wordpress js with gzip?
I tried again on a different server:
and with --compressed
Code: Select all
[root@atl ~]# curl -H "Accept-Encoding: gzip" -I http://wordpress.highlands.ac.uk/wp-includes/js/wp-embed.min.js
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 1403
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Date: Wed, 08 Jun 2016 13:03:32 GMT
Content-Type: application/javascript
ETag: "57569748-57b"
Server: nginx
Accept-Ranges: bytes
Last-Modified: Tue, 07 Jun 2016 09:43:36 GMT
Vary: Accept-Encoding
Cache-Control: max-age=315360000
Code: Select all
[root@atl ~]# curl -H "Accept-Encoding: gzip" --compressed -I http://wordpress.highlands.ac.uk/wp-includes/js/wp-embed.min.js
HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 1403
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Date: Wed, 08 Jun 2016 13:04:04 GMT
Content-Type: application/javascript
ETag: "57569748-57b"
Server: nginx
Accept-Ranges: bytes
Last-Modified: Tue, 07 Jun 2016 09:43:36 GMT
Vary: Accept-Encoding
Cache-Control: max-age=315360000
Re: nginx wordpress js with gzip?
strange, I just edited the config changed gzip to off, ran the curl on my machine again and came back as expected
changed it back to on, and as expected at the bottom when running the command again:
Code: Select all
curl -H "Accept-Encoding: gzip" -I http://wordpress.highlands.ac.uk/wp-includes/js/wp-embed.min.js
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 08 Jun 2016 13:10:48 GMT
Content-Type: application/javascript
Content-Length: 1403
Last-Modified: Tue, 07 Jun 2016 09:43:36 GMT
Connection: keep-alive
Keep-Alive: timeout=60
ETag: "57569748-57b"
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
Accept-Ranges: bytes
Code: Select all
Content-Encoding: gzip
Re: nginx wordpress js with gzip?
When I view it with Google Chrome css and js files are not sending the header either.
Request URL:http://wordpress.highlands.ac.uk/wp-con ... styles.css
HTTP/1.1 304 Not Modified
Connection: Keep-Alive
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Date: Wed, 08 Jun 2016 13:32:39 GMT
ETag: "575696ed-69b"
Server: nginx
Last-Modified: Tue, 07 Jun 2016 09:42:05 GMT
Cache-Control: max-age=315360000
Re: nginx wordpress js with gzip?
I managed to resolve this. It was to do with the firewall (tmg 2010) not passing on from the client to the webserver that the client is gzip ready.