faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
feepbot has quit [Ping timeout: 258 seconds]
feepbot has joined #amber
<FromGitter> <damianham> hey guys HNY to all. I just wanted to run something by you for your opinion. I want to implement a pipe that acts a a request proxy to openlayers tile servers that I insert into the static pipeline that traps Amber::Exceptions::RouteNotFound from the Static pipe and if the request path matches a REGEXP will download the resource from upstream and save it locally in the static folder to satisfy subsequent
<FromGitter> ... requests. I save the response from the upstream to the local file then call Amber::Pipe::Static.call(context) to serve the file to the client. Do you think that is a reasonable way to go about it or would you solve this problem another (simpler way)? The code for the pipe is 121 lines for 4 different upstream tile server ... [https://gitter.im/amberframework/amber?at=5e0db7d90c3aeb107d904b31]
_whitelogger has joined #amber
_whitelogger has joined #amber
<FromGitter> <eliasjpr> I think that’s a very good approach. Now I’ll be worried of the regex and making sure it re raises route not found for non matches
<FromGitter> <drujensen> @damianham sounds like the right approach. Do you know if the tiles are pushed to a CDN? I don’t know much about OpenLayeers.
<FromGitter> <drujensen> Also you may want to consider how you would update the tiles if they change
<FromGitter> <drujensen> the cache may get old