launch 28 October, 2009

I have updated my showcase page, notice the first item in the list: This web page is not new (it was “born” more than 5 years ago), but our company has bought it earlier this year. And now we have re-realesed it after we have built it from scratch. All that is left is the data (over 4.3 million images), everything else (including the database) is brand new. This is one of the on-going projects so expect to see some related posts in the future.

Some things I learned during the development:

  • Don’t use PHP to import 4 million images (read them from the original DB, store them in the new DB, read the original file and resize it to 4 different sizes and store them in a new location), it is just to slow. The import was running for 1 week.
  • There are tons and tons of useless one-line jQuery “plugins” out there.
  • Don’t care if your JavaScript file is 5 lines long, combine, minify & cache all your JavaScript files so that the browser only needs to make one request to get all the code it needs. Do the same for CSS (haven’t done this for CSS yet).
  • Do research for cool new technologies you could use before you start coding. I missed a wonderful opportunity to use Sass because I found it after most of the CSS was already written.
  • Cache cache and cache!

mojalbum (1)

If you wish to discuss this post please use twitter or contact me.


Mark Kadlec November 4, 2009 at 4:57 am

Great post, I always like to hear honest retrospective from some of these projects.

I am shocked that you used PHP to import the images, I think I would have pulled the plug on that import after 1 hour. :)

Sounds like you noticed a performance boost with minifying even small pieces of Javascript, that’s good to know.

Jan Hančič November 4, 2009 at 8:55 am


well coding the importer in something else could have easily taken the same time PHP used to do the importing since I’m a little bit rusty in anything else than PHP. And the import script is/was huge, a lot of logic and what not.

As for JS: the main performance came from combining all the JS files into one so that the browser only makes one request. And using HTTP caching. Minifying was just the cherry on top :)