facebook/tornado — pull request #409 by birknilson (2011-12-02 16:05:27+00:00)
Title: Ease customizations of StaticFileHandler in order to support CloudFront

In order to change how versioning of static urls are generated today one has to subclass the base class extensively. These changes allow for more specific subclassing without the need to duplicate code from the base class etc. It is now easier to change how version strings are generated as well as handling scenarios when the path has to be altered and will differentiate with the corresponding filesystem path.

2468216f Separates generation of version hash into its own method - allowing easier customizations.

782c4def Incorrect handling of hash in previous commit, this will ensure we check that the hash was successfully generated prior to slicing it.

59812edc Change the test case of customized static urls to deal with version strings being included in the filename rather than as a query parameter. In other words, testing that the functionality required for CloudFront will work.

1850e094 Small code change in order to conform with standards

34f5bd33 I am not sure whether this should be included in the framework. Generally, I dislike code with a very specific use-case to be introduced in a project which is intended to be generic in its use-cases. However, I guess there is a lot of people out there using CloudFront and if not it serves as a good example of how something similar could be done. I leave the decision of whether it should be included or not to you :)