Jacob
Jacob

Reputation: 6477

How to serve gzip js and css files -- Rails + CloudFront using Origin server (not S3)

I'm using CloudFront with an origin server (not S3).

How could I get my rails app to server Gzip versions of JS and CSS in this case?

Upvotes: 0

Views: 431

Answers (1)

smparkes
smparkes

Reputation: 14063

CF will serve gzipped content if your origin server provides gzipped content, so you need to see if you get gzipped content from your origin server, which depends on which backend server you're using.

One thing I recently noticed was that nginx doesn't by default serve gzipped data if the request uses HTTP 1.0, which CF does. There's an nginx directive, gzip_http_version, that can be used to allow it.

Upvotes: 3

Related Questions