• View our reviews on Hot Scripts
  • JS Tutorial

Recent Comments

Powered by Disqus

Javascript packing


You know why you should minify your javascript and CSS files. Files will take less space and they will download faster, thus making your website load faster. But what about javascript packing? What is the difference and do I need it? Well, idea javascript packing is similar to minifying, only it is more complex then just removing spaces and...

Comments Read more

Firebug for IE


It's easy to debug HTML or CSS code in browsers like Opera or Firefox, because they provide their own tools. There is a Dragonfly for Opera and Firebug for Firefox. But what about IE? Well there is an option to use firebug light version and inject it right into current page to have almost same functionality like with Firebug in...

Comments Read more

Collecting and debugging PHP and mysql errors


As you know it is advised to prevent showing PHP related error messages because of security issues. So how can you track if there are any errors in your script that might not only have effect on user experience, but also potentially create security holes for others to exploit. The best way is to create custom handlers for errors. You...

Comments Read more

Delay external content loading for better performance


It is hard to imagine website without without any external content. Either it is a sharing tool like twitter button, widget or even advertising like adsense, they're all using external scripts that will increase your website loading time. But that doesn't mean you shouldn't use any external content. Some of this tools are...

Comments Read more

Cache images from PHP output


Sometime you need to generated image using PHP and mostly it's because you want to make dynamical image, that changes often, like CAPTCHAs. But there are rare occasions, when this image do not change. OF course browser usually don't cache PHP generated images, but if image that is outputted by PHP doesn't change, why shouldn't...

Comments Read more

Optimizing site loading time using YSlow recommendations


YSlow is a firefox plugin that offers you optimization tips for your website by scanning it. To use YSlow you'll need to install Firebug plugin, then install YSlow plugin. And after that, press right mouse button anywhere on your website, choose "Inspect element" and click on YSlow tab. So before testing how YSlow tips improve...

Comments Read more

Compressing webpage content for faster page loading


There are many ways of how to compress your web page content, that is outputted to end user's browser. Most popular are: using apache mod_gzip or mod_deflate, using zlib compression or using ob_gzhandler. There are many opinions on which is better and probably there are no right answer, and since combined usage of this methods is not...

Comments Read more

CSS sprites to speed up page loading


What are CSS sprites? Well it's simply images used in website design, put in one image file. It means that browser needs to download only one image instead of multiple and as browser can can maintain only couple simultaneous connections, it needs one HTTP request and connection to download all design images, thus making all other site...

Comments Read more

Dynamically compress css and javascript files


One way to speed up your page loading time is to optimize all files needed for your website. For example, more file takes space (Kb, Mb, etc), more time it needs to be downloaded to end users computer to view your website. So if you make those file lesser, they will load faster. What are the options? For example, you can take all comments...

Comments Read more

PHP Zend Optimization


For many generic programming languages, efficiency of applications depends also on compiler used to compile application. But PHP is a general-purpose scripting language. It means PHP code is processed by an interpreter application. So is it still possible to optimize PHP applications performance on a "compilation"...

Comments Read more

Caching using mod_expires and mod_headers


With all growing traffic to websites, heavy graphic files and multiple simultaneous visitors, sometimes you need to use every tool you can, to optimize your site loading and achieve bets performance. One of the thing you must consider then is caching.  Main advantage of caching is that there is no need to download file again if it was...

Comments Read more

Adding CRON Job to your Cpanel


If you need to delete temporary files once in a while, or you want to perform database backups on a regular bases, you can do that using cron jobs. What cron job do is simply access your script or perform specified command in a specified period of time.  You've probably already noticed Cron job section in your hosting Cpanel or...

Comments Read more

Comparing file_get_contents with curl and curl multi handlers


There is a way to handle multiple HTTP requests using curl. For comparison we will request contents of same url 100 times  and for that we will use 3 different codes, one for file_get_contants, other for simple curl request and last for curl_multi request handling. Here is a file_get_contents function: <?php $domain =...

Comments Read more

Mysql query cache


There is another mysql related optimization options. It is called query caching. It means, that if you execute completely same queries two times, first one will get results from table, but second one will get results without actually searching the table, from cache of result of the first query. To check if you have query cache enabled,...

Comments Read more

Select random row faster


Selecting random row from mysql usual way is too slow, especially on tables with a lot of rows, because mysql needs to create temporary table. So never do ti this way: SELECT * FROM table_name ORDER BY RAND() LIMIT 1 It is much better to choose random number in php and then select row with that number. Of course you should know how...

Comments Read more

Indexing mysql tables


There is a way how to optimize mysql query execution time. And that is called index. Indexes help to find rows in tables faster, but it also increase insertion and update time. So it is best to use indexes in tables with a lot of rows and which are usually selected and more rarely updated or new rows inserted. To insert index you need to...

Comments Read more

Array initialization


There are lot of different ways how to initialize array in php. Which one is the best? which is the slowest? Here are some test results: <?php //average result: 0.0044 seconds. for ($i=0;$i<1001;$i++) { $a=array("1","2","3","4","5","6","7"); } //average result: 0.0021 seconds for ($i=0;$i<1001;$i++) { ...

Comments Read more

Dynamic sub-domains


Browsers usually have limit on how many files they can download from one domain simultaneously, so in theory, if you files would be on different domains or sub-domains, they will be downloaded simultaneously, thus loading your page faster. Of course you don't want to create different sub-domains for different files and you don't have...

Comments Read more