Re:Building Large Flask Apps in the Real World
by derefr on Wednesday February 17, 2016 @10:00PM
(#11123361)
I used this architecture myself for a while, but I don't think I would implement a new project in terms of it at this point. Given a caching reverse-proxy like CloudFlare, there's no disadvantage in serving your client from the app itself. Meanwhile, you get the advantage of being able to test the server during development by just hitting the single ip:port it's running on—and have your automated testing do the same with subrequests, by using the Host header from the request context—without having to make all your test-harness code "infrastructure-aware", teaching it about ports and figuring out ways to pass them in and route them through Docker and map them to domains instead of ports in production and such.
Re:Building Large Flask Apps in the Real World
by sandGorgon on Wednesday February 17, 2016 @10:04PM
(#11123382)
I'm just starting out in Javascript development and have been struggling with build system - how do you achieve cache busting hashes, etc which are necessary to use for a CDN?
We are using webpack and it seems hard to do it.
Re:Building Large Flask Apps in the Real World
by mslate on Wednesday February 17, 2016 @11:37PM
(#11123762)
I highly recommend surge.sh for easy static hosting--their cache-busting strategy is explained here:
Re:Building Large Flask Apps in the Real World
by sandGorgon on Thursday February 18, 2016 @01:18AM
(#11124022)
we use cloudfront and nginx for most of our infrastructure - kinda hard to move to surge right now.
ETags is not viable for this kind of a setup - it pretty much means triggering a nginx reload which is what a cache-busting signature avoids.
The trick with that is having to host them from separate domains and deal with CORS, however it also allows you to distribute your SPA via CDN instead of using Flask app servers to serve up that static content. This is what we do at my full-time gig, but same holds for Flask.