Gzip compression of static files on google cloud storage breaks site
I host my static site on google cloud storage.
My files without gzip compression make my site work perfectly.
When I gzip my files locally (with gzip -r folder
) prior to upload to my cloud storage bucket and run following command, my whole site breaks (images, js, css, all broken - no style information found warning etc.)
gsutil -m -h content-encoding:gzip rsync -c -r ~/my-gzipped-folder gs://example.com
Why the error and how to fix?
google-cloud-platform google-cloud-storage gzip gsutil static-site
add a comment |
I host my static site on google cloud storage.
My files without gzip compression make my site work perfectly.
When I gzip my files locally (with gzip -r folder
) prior to upload to my cloud storage bucket and run following command, my whole site breaks (images, js, css, all broken - no style information found warning etc.)
gsutil -m -h content-encoding:gzip rsync -c -r ~/my-gzipped-folder gs://example.com
Why the error and how to fix?
google-cloud-platform google-cloud-storage gzip gsutil static-site
If I understand correctly, thendecompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I usedgsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my aboversync
code with thecontent-encoding:gzip
) but thesetmeta
command did not work, it did nothing.
– proruzi
Nov 24 '18 at 15:59
add a comment |
I host my static site on google cloud storage.
My files without gzip compression make my site work perfectly.
When I gzip my files locally (with gzip -r folder
) prior to upload to my cloud storage bucket and run following command, my whole site breaks (images, js, css, all broken - no style information found warning etc.)
gsutil -m -h content-encoding:gzip rsync -c -r ~/my-gzipped-folder gs://example.com
Why the error and how to fix?
google-cloud-platform google-cloud-storage gzip gsutil static-site
I host my static site on google cloud storage.
My files without gzip compression make my site work perfectly.
When I gzip my files locally (with gzip -r folder
) prior to upload to my cloud storage bucket and run following command, my whole site breaks (images, js, css, all broken - no style information found warning etc.)
gsutil -m -h content-encoding:gzip rsync -c -r ~/my-gzipped-folder gs://example.com
Why the error and how to fix?
google-cloud-platform google-cloud-storage gzip gsutil static-site
google-cloud-platform google-cloud-storage gzip gsutil static-site
asked Nov 24 '18 at 14:12
proruziproruzi
263
263
If I understand correctly, thendecompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I usedgsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my aboversync
code with thecontent-encoding:gzip
) but thesetmeta
command did not work, it did nothing.
– proruzi
Nov 24 '18 at 15:59
add a comment |
If I understand correctly, thendecompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I usedgsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my aboversync
code with thecontent-encoding:gzip
) but thesetmeta
command did not work, it did nothing.
– proruzi
Nov 24 '18 at 15:59
If I understand correctly, then
decompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I used gsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my above rsync
code with the content-encoding:gzip
) but the setmeta
command did not work, it did nothing.– proruzi
Nov 24 '18 at 15:59
If I understand correctly, then
decompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I used gsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my above rsync
code with the content-encoding:gzip
) but the setmeta
command did not work, it did nothing.– proruzi
Nov 24 '18 at 15:59
add a comment |
2 Answers
2
active
oldest
votes
I think the answer to your question may be lying here.
There are two ways to prevent decompressive transcoding from
occurring:
If the request for the object includes an Accept-Encoding: gzip
header, the object is served as-is in that specific request, along
with a Content-Encoding: gzip response header.
If the Cache-Control metadata field for the object is set to
no-transform, the object is served as a compressed object in all
subsequent requests, regardless of any Accept-Encoding request
headers.
add a comment |
Seems I just had to upload my gzipped files without the .gz
extension and then all good.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459025%2fgzip-compression-of-static-files-on-google-cloud-storage-breaks-site%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think the answer to your question may be lying here.
There are two ways to prevent decompressive transcoding from
occurring:
If the request for the object includes an Accept-Encoding: gzip
header, the object is served as-is in that specific request, along
with a Content-Encoding: gzip response header.
If the Cache-Control metadata field for the object is set to
no-transform, the object is served as a compressed object in all
subsequent requests, regardless of any Accept-Encoding request
headers.
add a comment |
I think the answer to your question may be lying here.
There are two ways to prevent decompressive transcoding from
occurring:
If the request for the object includes an Accept-Encoding: gzip
header, the object is served as-is in that specific request, along
with a Content-Encoding: gzip response header.
If the Cache-Control metadata field for the object is set to
no-transform, the object is served as a compressed object in all
subsequent requests, regardless of any Accept-Encoding request
headers.
add a comment |
I think the answer to your question may be lying here.
There are two ways to prevent decompressive transcoding from
occurring:
If the request for the object includes an Accept-Encoding: gzip
header, the object is served as-is in that specific request, along
with a Content-Encoding: gzip response header.
If the Cache-Control metadata field for the object is set to
no-transform, the object is served as a compressed object in all
subsequent requests, regardless of any Accept-Encoding request
headers.
I think the answer to your question may be lying here.
There are two ways to prevent decompressive transcoding from
occurring:
If the request for the object includes an Accept-Encoding: gzip
header, the object is served as-is in that specific request, along
with a Content-Encoding: gzip response header.
If the Cache-Control metadata field for the object is set to
no-transform, the object is served as a compressed object in all
subsequent requests, regardless of any Accept-Encoding request
headers.
answered Nov 24 '18 at 14:22
MaximMaxim
1,506210
1,506210
add a comment |
add a comment |
Seems I just had to upload my gzipped files without the .gz
extension and then all good.
add a comment |
Seems I just had to upload my gzipped files without the .gz
extension and then all good.
add a comment |
Seems I just had to upload my gzipped files without the .gz
extension and then all good.
Seems I just had to upload my gzipped files without the .gz
extension and then all good.
answered Nov 24 '18 at 22:06
proruziproruzi
263
263
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53459025%2fgzip-compression-of-static-files-on-google-cloud-storage-breaks-site%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If I understand correctly, then
decompressive transcoding
is enabled somehow and that causes my site to break. To prevent/disable the transcoding I usedgsutil setmeta -h cache-control:no-transform gs://example.com/*
(right after my aboversync
code with thecontent-encoding:gzip
) but thesetmeta
command did not work, it did nothing.– proruzi
Nov 24 '18 at 15:59