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 5 commits
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.
Just wondering ... what does template.render do? Does it have any unnecessary overhead? Is there a reference link you can point to that says "this is the preferred way to serve static files"?
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 don't think this is "the preferred way" to serve static files, but this is what was in the documentation and I expect that since it comes bundled with webapp, then it should have been optimized for the purpose.
https://webapp2.readthedocs.io/en/latest/tutorials/gettingstarted/templates.html
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.
template.render is similar to rendering with jinja, but it uses Django templating instead, so I'm not sure it's what you want to do here if your aim is to serve the files statically.
If you do want to serve a file statically, then typically that is done in app.yaml -- see https://cloud.google.com/appengine/docs/standard/python/config/appref
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.
(You might also want to try the three ways -- jinja render, django template.render, and app.yaml static rendering -- and compare their times.)
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.
app.yaml - 42ms
Jinja render - 147ms
template.render - 119ms
So we should go with app.yaml, but how about the headers?