Perhaps I am doing this the wrong way, but when building REST services in Python 2.7 and trying to be all fancy and object oriented, returning JSON starts to get complicated. For example, while building a Docker Managment/Statistics tool, I wanted to make sure that the data I retrieve from cAdvisor is nicely handled in classes so that all the data is easy to use and controlled, so I create classes for the cAdvisor data, including container and host machine information.
So, in my eternal search for sub 100ms TTFB for all sites we work on, have been working on further improvements to our NGINX based load balancer/accelerator. We front all of our web sites and applications and sites with NGINX, and it has served us very well so far. With a great deal of our sites powered by node.js, which tends to suck at file serving we have been looking beyond just caching, looking to further steps the eliminate even more calls to the web servers (not only for node, but for PHP sites as well.) Getting nginx to pull files from memached is pretty straight forward, (more on that later), but the problem is how to get those assets into memcached in the first place. The obvious solution is to modify the application's code to put their html output into memcache themselves... but this has not always been practical. An elegant hack? So to get the ball rolling without touching the app code, I put together a python app which pulls files down, and puts them into me...