views:

62

answers:

3

It seems like static files can only be served from the same domain as the app.

I could create a new app for hosting static files but I'm a little nervous that that would a violation of the terms of service.

+1  A: 

Section 4.4 of the terms of service prohibit one from splitting one logical app into two pieces - so hosting your dynamic content and static content in two separate GAE apps would violate the terms.

However, you could host static files on another web hosting service - anything from a simple shared hosting solution all the way up to a big CDN. This approach enables your site to serve static content from domains other than your app's domain.

David Underhill
+2  A: 

You don't need to serve your static content from a different app, you just need to use a different hostname. App Engine makes it pretty easy to have many different hostnames that point to the same app.

With wildcard subdomains you don't even have to create a DNS entry. If your app lives at myapp.appspot.com, you can also reach it through any subdomain, like static.myapp.appspot.com. If you're using your own domain, you'll need to configure it manually.

Drew Sears
Just to clarify, the procedure Drew is describing works for custom domains, too: www.myapp.com and static.myapp.com can be configured to point to the same app
Nick Johnson
A: 

"4.4. You may not develop multiple Applications to simulate or act as a single Application or otherwise access the Service in a manner intended to avoid incurring fees"

"You may not develop" but, you can "Enable Billing" for multiple application. An example:

1) mysite.appspot.com
2) mysite-static.appspot.com
3) mysite-data-service.appspot.com

B11002