• 13 September 2015Improving the responsiveness of the site

    Wow.. I am done refactoring the website to the symfony framework! I'm actually surprised how easy it has been and wish I had done it sooner. I started September 3rd, and I have now converted all the pages, the build scripts, the deployment script. Everything seems to work fine. It took ~11 days and a little under 30 hours total, which is pretty impressive.

    So this is an interesting experience. Years ago when I wanted to make my own "lightweight" MVC to learn more about php and web development... I knew refactoring was a big pain. And so I made a fortuitous decision to use a well designed API as a guide instead of trying to make my own from scratch. It was a great learning experience. I basically implemented all the basic MVC components from symfony such as Request, Response, Context, and so on. I left out everything I didn't need or I didn't understand. I also included classes from symfony as is where that made sense, for example the routing system, which didn't make sense for me to try to simplify. I was basically taking a grand tour through an MVC, and through symfony's code I was learning about all kinds of php functions and programming tricks.

    Since I followed a well designed framework's conventions, the "actions" and "views" where much of the magic happens required practically no changes. I use a Zend_Db like API for the database, and a bunch of other custom classes so I had to create a bridge between my classes and those of symfony, but for the most part it's pretty clean and makes sense to me. Though the website is not entirely written in the symfony "style", there is no overhead. Either my classes, or symfony's classes are used depending on the type of functionality. For example I have a simpler version of the "sfView" class which I use for rendering many widgets such as the ajax tables.

    So this is great. I now I have access to a much more complete framework, and in particular powerful caching capabilities. In the coming week I am going to explore those caching features and try to speed up the Study pages as much as I can.