May 262015

The distance between the location where a web service is hosted and the locations of users that access its content can have a great impact on the effective page load time. For instance, australian and american users of a web site located in Spain or Germany will experience a noticeably longer page load time than european users.

This problem can be avoided with the help of a Content Delivery Network (CDN).

This post explains the characteristics of this kind of service, with the example of a wordpress site that is configured to make use of the CloudFlare CDN.

Continue reading »

 Posted by at 3:05 pm
Apr 272015

One of the most common operations in the development of a project that makes use of a version control system, is that of reviewing the differences between the local copy of a given file in the working area, and the last version of the same file stored in the repository.

Using a graphical comparison tool for this operation may help greatly to perform this task. A tool of this kind will show both versions of the file side-by-side, highlighting the lines that have been added, deleted of modified.

This post explains how to do this and other similar operations in a project that uses git as version control system.

Continue reading »

 Posted by at 7:50 am
Mar 272015

We have already stressed in previous posts the importance of the time it takes for a web page to be fully loaded in the client browser: users will get a better impression of the site if the content is “snappy”. Besides, the page load time is a factor that the major search engines, including Google, take into account in their ranking algorithms.

Downloading and processing external resources is often one of the main contributions to the total page load time. Among these resources, external javascript libraries and CSS stylesheets are most often the main contributors to this.

We have already covered in our previous post on “How to reduce the page load time with asynchronous javascript” the way to load javascript resources in parallel with the main HTML document, so as not to block the rendering of the above-the-fold content.

This post continues the series on web site optimization techniques, explaining how to load asynchronously external CSS stylesheets.

Continue reading »

 Posted by at 3:27 pm
Mar 232015

In most programming languages, there is a built-in function sleep(), wait() or similar that will suspend the execution of the program or script for a given amount of time, normally expressed in milliseconds, without CPU consumption. A call to this function is commonly used inside a loop that check for the availability of some resource required to continue the execution.

In javascript, there is no such function, but a setTimeout() function that schedules the execution of a function after a specified number of milliseconds.

Continue reading »

 Posted by at 12:42 pm
Mar 202015

The total page load time is an important factor to be considered in the optimization of a web site. Among the many elements that contribute to the total time required to load a page, one of the most relevant may be the loading and execution of the external javascript code referenced in the page.

This post explains how to load the javascript code asynchronously to decrease the page load time, and the technical considerations involved in the implementation of this improvement.

Continue reading »

 Posted by at 9:20 am
Mar 112015

Factual is a geographical database of places, services, points of interest and landmarks that is made available for free through their Application Programming Interface (API)

This post explains how to use a PHP library to access this database, the characteristics of the service, and the details on the content that can be retrieved from the Factual API.

Continue reading »

 Posted by at 9:57 am
Mar 112015

A website with information of any kind about a certain geographical location might find interesting to include a list of places, points of interest, businesses and services available in that area.

Yelp is one of the possible choices, together with Google Places, Facebook, etc. for a service provider that implements an API that can be used to retrieve that kind of information. This post explains how to query the Yelp API from a PHP script to obtain a list of nearby places.

Continue reading »

 Posted by at 9:43 am
Mar 102015

The HTTP Working Group of the IETF (Internet Engineering Task Force) has approved on 17-Feb-2015 version 2 of the HTTP protocol (Hypertext Transfer Protocol 2 specification).  This new version will gradually replace the older HTTP/1.0 and HTTP/1.1 versions, that for many years have been one of the basic building blocks of the web (HTTP/1.1 was approved on 1999).

Together with HTTP/2, the Working Group has approved the HPACK specification for the compression of HTTP/2 headers.

This new version of the HTTP protocol is intended to solve the shortcomings of the previous versions, by implementing several improvements, as explained in this post.

Continue reading »

 Posted by at 9:59 am
Mar 102015

One of the keys in the success of WordPress as one of the most popular content management systems lies in its flexibility to add new functionality, or modify the existing functionality, by means of plugins. WordPress plugins attach the extra functionality thy implement to “hooks” in the wordpress code.

Hooks are points defined in many places of the wordpress base code. A hook can be an action or a filter: filters are used when part of the HTML code being generated needs to be modified. The original HTML code is passed as an argument to the filter, and the filter return the modified code.This post explains the implementation details of action and filter hooks in wordpress.

Continue reading »

 Posted by at 9:49 am