Optimise Laravel application

Laravel by default keeps log of SQL Queries that should be disabled on a production website. This can be done by adding DB::disableQueryLog(); to /bootstrap/start.php like so:

// disable query log for productions site
if($env == 'production')

Next it's a good idea to update and optimise your start up scripts by running commands below

composer dump-autoload
php artisan clear-compiled
php artisan optimize

If you use Laravel 5 you can also run

php artisan config:cache 
php artisan route:cach

Other things you should check

  1. Use session driver like redis instead of file
  2. use redis or memcached or similar for caching
  3. cache non volatile query results
  4. remove or comment out unused providers
  5. use deferred service providers when possible. "A deferred service provider is only loaded and registered when one of the services it provides is actually needed by the application"
  6. use eager loading to load related models when needed. It's a good idea to enable query logging and monitor all requests as you develop. This can greatly help to reduce number of unnecessary queries
  7. disable query logging on production server. See notes above.
  8. minify your output, including html, js and css

How to Create and install SSL Certificate on Apache for Ubuntu 14.04

This tutorial shows how to create and install a security certificate on an apache server.

htaccess permanent 301 redirect

A few years ago I wrote an article about different options to do a HTML page redirect. Since then I've been asked many time about different scenarios for setting a permanent 301 redirect using .htaccess file.

custom policy for amaon S3 backet access

Recently I had a bit of a challenge getting my policy right to enable a single bucket access on amazon s3. After few trial and errors I managed to get it right and decided to post my solution here as I did not found a single resource that had all the answers.

Joomla module position in template override

Adding a module position in template override can be very helpful. For example you may want to add a module position within a K2 template override or even in a content's article override.

Multiple categories update for K2 version 2.6.9

Updated multicategory patch for K2 version 2.6.8 is here! Thank you for you support! 

mysql slow queries

Optimising a mysql database is one of important steps in improving your website performace and the first step is to identify slow queries. Luckely mysql has an option to log slow queries, which we can then use to identify queires that causing a problem.

view live MySQL queries

Live sql queries can be viewed using the general query log and tail command in Linux

Disable "No Right Click" Scripts in Firefox

Disabling the right click menu can be useful when using things like wysiwyg edotors, but some websites use this feature to disable right click menu on the entire page to prevent users accessing menus like view code or download images. But as a developer being able to access the right click menu is handy. Good news that ability to block right click menu by scripts can be disabled in 6 easy steps.

Server load testing

Have you ever thought how many concurrent users your website or the server can sustain before running out of resources? Load testing can be very useful in getting ready or answering this question and put you in a proactive position for resolving potential issues.

Multiple categories update for K2 version 2.6.8

It has been a while since JoomlaWorks releacded a new version of K2, but finaly the K2 version 2.6.8 is here and so is the new patch! The new K2 multi categories patch includes the following changes:

  • updated the multi categories patch to work with K2 version 2.6.8
  • added support for the calendar in the K2 tools
  • fixed strict error message
  •  Start 
  •  Prev 
  •  1  2  3  4  5 
  •  Next 
  •  End 

Page 1 of 5

Free business joomla templates