A day of optimization….
Feb 27th, 2007 by Jessica
Well entire last week was spent on optimization, and we continued working on it today.
All dynamic front page information is now cached… and we are not relying on MYSQL cache any more, now it is cached on the application level so page should load much faster.
For Coders:
Idea is basically to create an array or PHP object with all the prepared (ready to output) data, use PHP “serialize” function and put the result in a file or in a small table with a “BLOB” field. On The Doll Palace we used our main table for settings, this table has following columns: name (varchar), value (text) and date_value(datetime) columns.
Caching mechanism is doing a select for “value” with name and date_value in where clause. If row is found it takes the value, unserialize it and feeds to the main application. If row is not found, it calculates all the values, updates the DB and feeds the values to the application.