News for hackers. Stuff that matters.
Re:Making the Switch from Amazon Cloudfront to Fastly by jconley on Monday July 30, 2012 @04:23PM (#4314487)
Wow, Firebase needs a new static asset management system. The fact that entire set of static assets have to be purged and can't be served with a 1YR cache timeout is a big red flag. Independent file versioning, whether through a version number or hashing, should be put into play.
Re:Making the Switch from Amazon Cloudfront to Fastly by vikrum on Monday July 30, 2012 @04:42PM (#4314569)
That sounds like an interesting approach. We push out breaking changes to our server and client libraries several times a week. Since we invalidate our CDN on each deploy and set headers indicate as such, we can quickly and seamlessly migrate our end users without having them modify their <script> include.

At present, our library is unlike other mature javascript libraries that can make use of a very high cache timeout. How would the 1yr cache timeout work for the library that is changing several times a week?

Re:Making the Switch from Amazon Cloudfront to Fastly by moonboots on Monday July 30, 2012 @05:28PM (#4314772)
Steve Souders blogged about how to serve scripts with far future expires without updating the client's script tag [1]. This technique initially loads the (potentially stale) js from the client's cache and checks for updates in the background, updating the client's cache if a new version is detected.

[1] http://www.stevesouders.com/blog/2012/05/22/self-updating-sc...

Re:Making the Switch from Amazon Cloudfront to Fastly by jconley on Monday July 30, 2012 @05:44PM (#4314852)
Yes, this is a great approach for javascript code. Usually, like in this case, there is something that will be faster than a round trip to check for if-modified-since or the ETag, which I would assume is used to do the invalidation in this case. Of course, YMMV, and if fastly is close enough to the edge and there aren't very many requests, this kind of optimization won't be required.

There might also be an opportunity to modify what is served from the customer's sites, depending on how all that is architected.

Re:Making the Switch from Amazon Cloudfront to Fastly by bryanh on Monday July 30, 2012 @05:07PM (#4314693)
I think he might be referring to a 1yr cache timeout on things like the logo.
Re:Making the Switch from Amazon Cloudfront to Fastly by mayop100 on Monday July 30, 2012 @05:42PM (#4314843)
Keep in mind that we can't afford to have a constantly-changing resource name, as 3rd-party developers link directly to our assets. For our own website, this might work fine, but even then it's a pain and doesn't work for all assets (such as for your index.html pages).
Re:Making the Switch from Amazon Cloudfront to Fastly by sintaks on Tuesday July 31, 2012 @02:56AM (#4316058)
Make the main asset that your 3rd-party devs load a loader, and not the lib itself. Teach the loader how to find out where the latest version is, and how to load it. Then teach it to sing, and, preferably, to dance.