Web application should run as quickly as possible. Amazon found that every 100ms of latency cost them 1% in sales. Google found that extra .5 seconds in search page generation time dropped traffic by 20%. Broker can lose $4 million in revenues per millisecond if his electronic trading platform is 5 milliseconds behind the competition! It is important not just to develop web application but to develop fast web application, which will result in accelerating revenue. Is Laravel fast enough to use it for custom software development?
As a rule, caching is the way to increase application performance by storing in the filesystem or in memory results of such expensive operations as requests to the database server.
The most common way of explaining the power of cache is via analogy.
‘Caching is like storing milk in the home refrigerator, so you don't have to go to the store (or the farm) every time you need it.’
CEO of Brightidea, San Francisco Bay Area, the USA
Laravel PHP Framework provides wonderful built-in tool to keep the Laravel applications fast – so called cache drivers.
How does caching work in Laravel?
After customers enter an URL of your application into browser, the physical server, where your application is hosted, will receive a request, process it (in a lot of cases, by making requests to the database server), and send back a response. A large number of complex requests to the database server is one of the most resource-intensive operations.
Imagine that 1,000+ Internet users visit your website simultaneously and make requests to the database server! You should have very expensive equipment to handle them all as fast as possible. It’s much more efficient to transfer the most requested pages once, cache them and then serve future requests directly from the cache.
Laravel supports popular cache backends like Memcached and Redis out of the box. By default, Laravel is configured to use the file cache driver, which stores cached objects in the filesystem. For larger applications, it is better to use an in-memory cache such as Memcached or APC. However, with Laravel it is even possible to configure multiple cache configurations for the same driver.
‘I have moved several slow WordPress sites to Laravel. Speed improvement is about 700%. 10s (WordPress) - 1.5 s. (Laravel).’
How much faster can caching make Laravel applications?
The performance can be improved twice just by using cache! Awesome enough, right? Besides this, our developers know that there are some other technics to boost speed of the php-based application.
Check out also this package to optimize your site automatically which results on a 35%+ optimization.
- Inlines small external CSS files;
- Removes unnecessary attributes in HTML tags;
- Injects tags in the HEAD to enable the browser to do DNS prefetching;
- Removes unnecessary quotes in HTML tags;
- Removes unnecessary prefixes from URLs;
- Removes unnecessary whitespace in HTML;
- Removes HTML comments.
Also, see our Laravel tutorial for beginners.
Rate this article
Do you have a software development project to implement? We have people to work on it.
We will be glad to answer all your questions as well as estimate any project of yours.
Use the form below to describe the project and we will get in touch with you within 1 business day.