{"push_id":1056789105,"size":1,"distinct_size":1,"ref":"refs/heads/port-competition-to-rails-performance-improvements","head":"50451953c0bc12bec0a6d5bb912b9820a41e67b5","before":"3452483d0d0782563927e2ce4dae073eb903d87f","commits":[{"sha":"50451953c0bc12bec0a6d5bb912b9820a41e67b5","author":{"email":"9dac087d10b02688772aaadaf18c1e02b55f24ae@gmail.com","name":"Tim Habermaas"},"message":"Cache competition results\n\nI didn't cache the podiums and winners pages because caching them was\nactually slower than not caching them at all (~65ms vs ~45ms). The\nresults/by_person and results/all pages are cached using a cache key\nlike:\n\n    USNationals2015/2016-04-01T20:32:14Z/by_person/d9fb66b120b61f4...\n\nThe last part is generated by Rails and is the MD5 hash of the template\nitself. Therefore it isn't technically necessary to include the string\n\"by_person\", but I liked the explicity of it and I feel it's less\nconfusing for people not terrible familiar with fragment caching.\n\nThe second part is the `updated_at` column of the newest result for that\ncompetition. There was no such column and adding one the Rails way\nwould've required us to update the PHP code, so I used a self-updating\ncolumn as described in:\nhttp://gusiev.com/2009/04/update-and-create-timestamps-with-mysql/\nAs explained in the blog post you can't have two columns with `DEFAULT\nNOW()` in MySQL without changing the `INSERT` code. That's why I didn't\nadd the `created_at` column as well.\n\nThe average response times for USNationals2015 dropped from ~700ms to\n~150ms.","distinct":true,"url":"https://api.github.com/repos/timhabermaas/worldcubeassociation.org/commits/50451953c0bc12bec0a6d5bb912b9820a41e67b5"}]}