Speed tests for websites and web apps
Here we have some tools and solutions to test and increase the speed of our web applications. With PHP 7. every web application based on this technology will be faster twice! But we need to be very careful to update the PHP version: not every application can work correctly.
- Compress HTML with PHP
- Compress CSS
- Compress Javascripts files
- Google Speed
- YSLOW Yahoo tool
- Smushit
- Neustar
- Put your javascrtpt on the bottom page, before tag </body> to allow to load HTML & CSS before all and show the page more quickly. The search engines will appreciate this technique! An online tool is YUICompressor or try Google HTML Compressor.
- WebPageTest
- Webmaster tools
- Load Impact
- Pingdom
- Which Load Faster
Resources
Documentation
Further Reading
- PhpRiot articles about Zend_Service_Amazon_S3 and Zend_Cache
- Beyond Gzipping (Tony Gentilcore, Google)
- Exception Performance (Yahoo! Developer Network)
- Best Practices for Speeding Up Your Web Site (Yahoo! Developer Network)
- Using Site Speed in Search Engine Ranking (Google Webmaster Central Blog)
Other Options
- Download a PDF version of this article
- Put your PHP knowledge to the test with our online and iPad/iPhone quizzes
- View or post comments for this article
- Browse similar articles by tag: Amazon, Google, Page Speed, PHP, Yslow, yuicompressor
Do you want to obtain the maximum performance on your website? First of all, I suggest simple techniques: put your javascript before closing the html body tag, compress css, compress javascript, compress your html.
If you have a dynamic website, you can use some function about the output buffer to compress the html. It will be more easy to compress CSS and Javascript, because they are more static. If you can do all with HTML and CSS, do it! Use javascript only if you want to obtain some effects. Make your website accessilble to let all users to browse on your website. So if you have done this, your work is finishede at 70-80%!
SOME COMPRESSION TOOLS
HOW ABOUT A CMS?
If you are using a CMS like Wordpress, Drupal or Joomla try to install a plugin or an utility for caching. Reduce the charge of the memory and verify your loading time. I suggest to install the simple tool Page Speed on Google Chrome to analyze your pages and it's very simple to use.
MINIFY CSS
Compress all css in 1 line only code. You can do it with PHP. In this way, you can have your css on your server but when you upload it, PHP will delete comments and all carriage return characters. You can also include small CSS files directly on your page (for example the CSS for the print version). Check out minify on google code.
SPRITE
Google and all serch engines recommend to use sprite images when possibile. But is it real right? I'm afraid to have some problems on different resolutions and different browser if you don't pay the right attention on css values and views. Sure you can take many advantages building and using a single image for your website or application.
- CSS Sprite Generator - load a zip file with all images to generate image and html and css code (Italian)
- CSS Sprite Generator - loading single image
CONCLUSIONS
This seems an underrated problem but if you follow my hints above, you can have big results without being crazy searching too complex solutions to compress HTML, CSS and Javascript code. All suggests and comments are welcome!