Press "Enter" to skip to content

Fastest web application ?

Fast means fast. Web application nowadays can offer much more in very less effort. But we also need fast delivery of the responses for the incoming request. So, here is the list I maintain for my application to be faster.

Never use resources inside a loop

Resources are not supposed to be used inside loops. Resources means mechanism that has capability to communicate with other application. For example, database connection. It is highly recommended  that never perform any SQL queries inside a loop.

Same goes for sockets, file operations etc.

Use cache

If you result is always the same, it’s better to use cache or hard code those stuff. Often in laravel, I keep these in a environment of config files. No need to call upon database or any other APIs.

Proper response headers

Don’t accept the improper data. Use accept header in every request. Tell the server what kind of data is acceptable. It leads to filtering of data that can be passed. This way your server does not have to serve requests that they cannot.

Also,  respond with status code rather than text. This is much faster because there is less data to transfer.

Compress your data

Always compress textual data using gzip.  It means less data to transfer for servers. But don’t over do it. Do not compress data less than 10KB. Learn how to compress data here.

Negotiate the content

Content negotiation is something that happens in API programming. You ask the server what data is required and what data is not required. For example, you can ask for email only in scope, so that server will only send email addresses discarding rest.

Optimize and minify

  1. Don’t make unnecessary requests. Combine your asset files into one single file.
  2. Remove unnecessary plugins.
  3. Minify all the files of javascript, css and possibly html too.
  4. Optimize the images. The quality of images of 10MB can be reduced to 700KB without loosing much quality for the web.
  5. Try to retrieve the data separately if not needed immediately like using pagination or lazy loading.

Terminate the application

Application takes up memory space, so try to terminate the application as soon as it is possible.

Use better technologies

  1. Try to use dedicated servers rather than shared hosting. They are cheap nowadays. Sign Up here for digital ocean. You will get $10 for free.
  2. Don’t use file based drivers. Consider using the available alternatives like redis or memcached.
  3. Use Algolia, solr or lucene for search systems. Your database will have less requests to deal with.
  4. Refer 3rd party scripts to cdn ( content delivery network ). Their servers are generally faster and handle more requests with efficient cache system.

Check out these websites. They open very fast in the browser.

  1. Housing
  2. Housing anywhere
  3. Laravel
  4. Secure
  5. Varvy

Everything is awesome.

Be First to Comment

    Leave a Reply

    Your email address will not be published.