Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serve static pages from app.yaml #6974
Serve static pages from app.yaml #6974
Changes from 1 commit
0bc53bb
df266a2
8b63d34
9106197
6d2cdb9
77fc41d
e3f24b7
fff201a
9baa459
3458a6b
6df30d8
a209b4e
7ccbf19
04bd338
f27d23b
c6617b5
81922b9
9104bca
abddd81
33c6f79
d99be7c
bd7eca5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can remove
Cache-Control
andExpires
, becauseexpiration
sets it automatically, but please check it in your browser dev console.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they are set automatically, but not with the same values
Cache-Control
is set topublic
whileExpires
is set to the current dateThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's okay in this case. Since the pages are now static we can cache them for 0 seconds and save few KiBs by using cache validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question about this -- if we update the page, will the updates be displayed correctly to the user or will they get a cached version? I don't see any build hashes, so just wanted to double-check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll need to add the regex for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(To clarify, my previous question was more for @vojtechjelinek)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because the
Expires
will always be in the past, the browser will do a check if the file is the same as in the cache (by using hashes). If the file is different the new version will be sent, if the file is the same the cache version will be used.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, thanks! But that is the part I don't understand, since the URL is currently hardcoded. How would we use hashes in that case?
Also, I was just wondering -- why this is placed in the "dynamic" section of app.yaml when these are meant to be statically served?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything will be handled by the HTTP. To simplify it: if the cache is not expired the cached version is used, if the cache is expired the HTTP makes an check call, if the file is the same 302 is returned if the file is different 200 is returned together with the new file.