Robert Munteanu
Robert Munteanu

Reputation: 68318

Do requests to static files cause the application to start up in GAE?

For instance, if I have robots.txt declared as a static resource, and assuming that the application is stopped, does accessing it cause my application to be started ?

Upvotes: 3

Views: 251

Answers (3)

Nick Johnson
Nick Johnson

Reputation: 101149

No.

Requests for static files are served by a separate infrastructure to other requests. They never reach the app server. This is also why static content is not accessible by a deployed app.

Upvotes: 4

Tom van Enckevort
Tom van Enckevort

Reputation: 4198

Have a look here. Judging by that I would say that if a file is marked as a static file in your appengine-web.xml file, it will be served without restarting your application. But if you have the file marked as a resource file, it will be considered part of your application and therefore it would restart the app when serving that file.

So just make sure your static files are under the static_files element and then you should be fine.

Upvotes: 1

Drew Sears
Drew Sears

Reputation: 12838

I can't speak authoritatively, but my guess is that it won't, for a few reasons.

http://code.google.com/appengine/docs/python/runtime.html#App_Caching

The concept of app persistence seems to be limited to caching imports referenced by a script, or if the script defines a main() function, caching the script itself.

If your app.yaml includes one or more script handlers and one or more static handlers, it wouldn't make sense for a request to a static file to "spin up" any or all of your script handlers.

Further, app caching is apparently be specific to individual web servers. Since static and dynamic files are handled by different webservers, I wouldn't expect a request for a static file to even be noticed by the dynamic content servers.

Upvotes: 1

Related Questions