Static HTML hosting in the game! application on CloudFront

I have (high traffic) my site which is completely static. All site URLs are relative, so now everything works if I just point my browser to http://gj232j2j213.cloudfront.net/blah.

I would like to place the whole thing (not only images and css, but also HTML) in Cloudfont (or some other CDN).

Ideally, I could add something like:

GET    /static/    staticDir:http://gj232j2j213.cloudfront.net/blah

in the routes file. Thus, my URLs would look like www.mydomain.com/static/main.html, and I would not have to deny the user another subdomain as they moved between my static and non-stationary URLs.

Any ideas? Am I mistaken?

+2
source share
2 answers

conf/routes :

# Map static resources from the /app/public folder to the /public path
#{if play.Play.mode.isDev()}
    GET     /public/                        staticDir:public
#{/}
#{else}
    GET     d2iu8jbjgczc8x.cloudfront.net/public  staticDir:public
    GET     /public/                              staticDir:public
#{/}

, URL- CloudFront ( Prod).

+4

Play 2.x.

GET     /public/      staticDir:public

, - .

GET  /somefile.html   controllers.Assets.at(path="/public", file="somefile.html")
+3

All Articles