How to Boost Magento Speed on Localhost/XAMPP

cachelocalhostmagento-1.9performancexampp

I have checked that Magento is running such slowly on localhost although my php.ini has the requirements to run Magento. However, its low performance and speed lack make my work so much slow and I would like to hear from you how I can speed up Magento locally, maybe installing some cache extension or something else like Memcached, Xcache or APC.

I'm on Windows 10 and xampp.

Best Answer

When developing localy on windows there are two common causes of delay, resolution of localhost is one and windows slow file operations due to complex OS ACL is the other.

To improve the situation you must replace every localhost entry in your magento installation with 127.0.0.1. Some people make an entry in their windows hosts file that allows localhost to be redirected to 127.0.0.1 , this will improve file serving time but php commands like PDO connect will still produce one second delay each until 127.0.0.1 has replaced localhost in settings.

To avoid windows slow file operations you need a opcode cache php accelerator like APC or WinCache. When developing in windows you can activate IIS and use Microsoft Web Platform Installer to install/configure PHP, MYSQL and WinCache in few clicks. When using xampp you can install APC with http://downloads.php.net/pierre/ or http://dev.freshsite.pl/php-accelerators/apc.html binaries or building APC with Visual Studio and then configure with directions from internet. From my experience last WinCache version is extremely fast and it is a real safe choice for windows. Very few developers i know use IIS instead of apache due to the bad past of IIS but at this time it is easier to setup, can handle more requests and it is faster in most parts when compared to apache in windows.

With those 2 changes you will see a 1000%-20000% improvement while configuring MySQL for production wont benefit a development environment at all. Tweaking cache and gzip in htaccess wont benefit a local environment either, firstly because you read the files directly from your hard disk (with a cache optimizer from memory) and secondly because it is a dynamic site that you will constantly change during development so you cant set expire times and disable etags.

To improve the speed even more you will have to tweak your template. In few words as all suggest combine all png that you can , convert to base64 the ones you cant combine and use a tool like Lab.js to control loading so you can make sure your page on load is less that 1.5 sec. When moving to production use a CDN to serve media. If all go well everything will be so fast you wont care again about HW benchmarks, DB optimization and hosting comparition until you have many thousands visits per day and serve a lot of content. (Static caching not dynamic pages / parts of pages and using magento cache system for your scripts for ultimate speed ).

P.S. Using windows client version to broadcast a site in the www is legal as long as you don't change the 20 concurrent connection limit in the OS from my understanding while reading the license.

Related Topic