You have configured Cloud CDN using HTTP(S) load balancing as the origin for cacheable content. Compression is configured on the web servers, but responses served by Cloud CDN are not compressed. What is the most likely cause of the problem?
A.
You have not configured compression in Cloud CDN.
B.
You have configured the web servers and Cloud CDN with different compression types.
C.
The web servers behind the load balancer are configured with different compression types.
D.
You have to configure the web servers to compress responses even if the request has a Via header.
Explanation:
The "Via" header in an HTTP request indicates the intermediate protocols and recipients between the client and the server. It's typically added by proxies, including Cloud CDN.
In some cases, if the web servers are configured to avoid compression for responses with a "Via" header, it might affect the behavior of Cloud CDN.
By configuring the web servers to compress responses even if the request has a "Via" header, you ensure that Cloud CDN responses are compressed regardless of the presence of this header.
Option D is not correct because the Via header is an HTTP header that is added by proxies, caches, and gateways. It is not related to compression of HTTP responses. Therefore, configuring web servers to compress responses even if the request has a Via header would not resolve the issue of Cloud CDN not compressing responses.
The correct answer is A. You have not configured compression in Cloud CDN.
Cloud CDN supports content compression, but it must be explicitly enabled through the use of the Accept-Encoding header in HTTP requests. By default, Cloud CDN does not compress cacheable content. To enable compression, you need to configure your origin server to send compressed responses, add the Accept-Encoding header to your client requests, and enable content compression in the Cloud CDN configuration.
A is INCORRECT. D is the right answer. A is wrong because the online documentation states the following:
"The presence of a Via header indicates that the request was forwarded by a proxy. HTTP proxies such as the external Application Load Balancer add a Via header to each request as required by the HTTP specification. To enable compression, you may have to override your web server's default configuration to tell it to compress responses even if the request had a Via header."
D: To enable compression, you may have to override your web server's default configuration to tell it to compress responses even if the request had a Via header.
D
Compression isn't working
Cloud CDN does not compress or decompress responses itself, but it can serve responses generated by your origin server that are compressed by using encodings such as gzip and DEFLATE.
If responses served by Cloud CDN are not compressed but should be, check that the web server software running on your instances is configured to compress responses. By default, some web server software automatically disables compression for requests that include a Via header.
To enable compression, you may have to override your web server's default configuration to tell it to compress responses even if the request had a Via header.
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
saurabh1805
Highly Voted 4 years, 3 months agoAzureDP900
1 year, 12 months agoxhilmi
Most Recent 11 months, 2 weeks agodidek1986
1 year, 3 months agoKomal697
1 year, 8 months ago3fd692e
1 month, 2 weeks agopk349
1 year, 10 months agoGCP72
2 years, 3 months agoLuvero
2 years, 9 months agokumarp6
2 years, 10 months ago[Removed]
4 years ago