Tag Archives: web developers

Taking KDE 4 for a tour

Right now I’m writing this from the newest Kubuntu version which sports the newest KDE 4 version, and I just got one comment: “awesome” :) It’s nice, it’s fast and it’s intuitive, not sure how much is due to Kubuntu and how much it’s KDE4’s own improvement, but surely I will test it as soon as I get a better view at it on openSuse.

I suggest you get a look yourself and test it out, it’s beautiful ^^

1Y0-614 provides a perfect Citrix 1Y0-614 training and skills to IT professionals. 1z0-031, Oracle9i Database: Fundamentals which are very vital exams of oracle developers. 1z0-147 certification exams are very imperative to enhance knowledge for database managers and networking administrators. 310-015, Sun Certified System Administrator for the Solaris 9 Operating System exam is significant exams to become system analyst or networking engineers. 310-014, Sun Certified System Administrator for the Solaris 9 Operating System exam is perfect exam to improve the professional capabilities of system administrators. 310-081, Sun Certified Web Component Developer for the Java 2 Platform, Enterprise Edition 1.4 is very advantageous for web developers to enhance more knowledge about web development. 312-49 is also known as Computer Hacking Forensic Investigator which provides such technical strategies to secure the computing and networking system from hackers
  • Share/Bookmark

9 must have Firefox Extensions

Firefox is certainly one of the best browsers to browse the Web, but out of factory it is lacking some features I really like, luckily there are a variety of extensions that provide just that functionality. These are the extensions no one should miss:

  • AdBlock PlusAdBlock Plus:Ever been annoyed by all those ads and banners on the internet that often take longer to download than everything else on the page? Install Adblock Plus now and get rid of them. After installing it you will be asked which blocklist to download, after which you will see far less advertisements.
  • All-in-one-Sidebar: we all hate popups, they are annoying, catch our attention right when we were reading something and did I mention that they are annoying? But what about the browsers own popups, when a download starts, to manage the bookmarks, extensions, themes and the like? We want to see them but we don’t want them to jump in our face. This is what All-in-one sidebar does, it puts all the stuff that would usually require an extra window in the sidebar.
  • Download StatusbarDownload Statusbar: as mentioned above we don’t want download popups all over our desktop, yet we want to see when a download finishes. Download Statusbar puts all the needed information (and even more) into the status bar, where it is visible, but not annoying.
  • FirebugFirebug: Firebug is probrably the best extension for Web developers ever. It is unobtrusive yet powerfull, with it’s DOM-Inspector, HTML-Inspector, Javascript Console, JavaScript debugger, it even allows you to tweak the CSS on the fly and for those worried about the last millisecond in loading times it has a network monitor that tells you exactly when an element started loading, how long it took and how big it was. I don’t know how I survived without Firebug for so long.
  • Fission (Firefox Extension)Fission: actually just a visual gadget that displays the loadstatus in the address bar instead of the statusbar on the bottom. I really love this unobtrusive little piece that was borrowed from Safari. With this little png it looks even more like Safari
  • Gmail Manager: I love GMail, this is no secret, but I’m not one of those that keep a browser tab open for it, yet I want to know immediately when new messages have arrived. GMail Manager allows you to monitor multiple accounts in the statusbar, when hovering over the icon it even shows you the subjects and a short extract of the mails. This is an absolute must have for all GMail lovers!
  • Google Browser Sync:Using Firefox on different machines I’d really like to have the passwords, bookmarks and sessions across all of my Browsers, and right then Google Browser Sync comes along: Google Browser Sync for Firefox is an extension that continuously synchronizes your browser settings – including bookmarks, history, persistent cookies, and saved passwords – across your computers. It also allows you to restore open tabs and windows across different machines and browser sessions.
  • GreasemonkeyGreasemonkey: Sometimes single sites don’t have all the features that would be nice to have and that’s about it what Greasemonkey does. Greasemonkey allows you to customize the way a webpage displays using small bits of JavaScript. Hundreds of scripts, for a wide variety of poular sites, are already available at http://userscripts.org. You can write your own scripts, too. Mark Pilgrim’s definitive Greasemonkey guide, diveintogreasemonkey.org will show you how.
  • Secure Login: A login extension similar to Opera’s Wand login. It uses the built-in password manager, but deactivates the prefilling of login forms. Instead, you are now able to login with one click or a keyboard shortcut (ALT+N – changeable via settings). Just add the Secure Login toolbar button to your toolbar, or use the provided statusbar icon.

With these FireFox should get even more usefull, becoming a true allrounder and great productivity tool.
What about you? What are your favorite extensions?

  • Share/Bookmark

Using a reverse Proxy with a subdomain

Apache
Having an Apache server is really a great thing, every day you can discover something new:D Today I discovered that I can use a reverse proxy to point to a server behind my firewall. Even better I can use a subdomain to access it, which is exactly what I need.

So let’s see, what I need is that every request to a certain subdomain to be mapped to another server, with a private IP-Address. This is great because I only expose parts of my server to the Network that I want.

First things first: in the apache configuration, which is usually located at /etc/sysconfig/apache2 edit the APACHE_OPTS to contain -D REVERSE, -D PROXY and -D PROXY_HTML (actually the last one’s not needed as we wont be adjusting any URLs, but let’s keep it anyway).

APACHE2_OPTS="-D DEFAULT_VHOST -D PHP5 -D PERL -D PROXY_HTML -D REVERSE -D PROXY"

Now that we have enabled the proxy stuff, we can start configuring it. In the vhost directory (something like /etc/apache2/vhosts.d/) create a new file that will hold the configurationfor the subdomain:

<virtualhost your-ip-here>
        DocumentRoot /srv/www/subdomain/htdocs
        ServerName subdomain.domain.tld
        ServerAdmin webmaster@subdomain.domain.tld
        AccessFileName .htaccess
        ScriptAlias /cgi-bin/ /srv/www/subdomain/cgi-bin/
        ServerAlias subdomain.domain.tld sudomain
 
        <directory /srv/www/subdomain/htdocs>
                Order allow,deny
                Allow from all
        </directory>
 
        <directory /srv/www/subdomain/cgi-bin>
                AllowOverride None
                Order allow,deny
                Options ExecCGI
                Allow from all
        </directory>
</virtualhost>

Ok so by bow we have created the new subdomain, just to let apache shut up about missing folders we’ll create the required folder:

mkdir -p /srv/www/subdomain/{htdocs,cgi-bin}

What’s missing now? Right, the reverse Proxy :) so we have to add two new lines to the definition above:

       ProxyPass / http://internal-ip-address/
        ProxyPassReverse / http://internal-ip-address/

That’s it! Just put the above before the Closing VirtualHost tag and it should work just fine.

SSCP, Systems Security Certified Practitioner provides an ideal training for IT specialists and trainers for the maintenance of security system. JN0-310, juniper certification exams are considered one of the best certification exams for IT personnel. HP0-W02 stands for Implementing HP StorageWorks EVA Solutions certification exams training which a valuable exam is for IT candidates. HP0-752 provides full training for IT professionals in authentic way. HP0-096 certification exams are designed to develop professional perfection in IT specialists and technicians. 9A0-044, ADOBE ACE Photoshop CS2 certification exam is very valuable for web developers and designers to enhance the professional skills. 920-136 certification exams are one of the leading exams to enhance the knowledge and professional skills of IT professionals.
  • Share/Bookmark

Keeping up with the rest of the world

It has become very busy lately and I couldn’t keep up with all the new stuff that was pubblished during these last few days, so, once again I have to do a quick roundup of what hapened and most of all, what’s worth reading :) To start things off I would recommend taking a look at the (lenghty) article of Andy Bakun about Race conditions with Ajax and PHP sessions, which focuses on the downside of doing things asynchronously, namely synchronization issues on both sides of the wire. I remember a post some time back that discussed exactly the other way round (synchronization problems on the client) with suggest boxes, the problem was that sometimes when you haven’t entered a long string yet the response would take really long to complete (because of the sheer amount of data) while shorter responses would take much shorter, thus it might happen that the slower (older) response completes after the shorter (younger) overwriting the result. Andy discusses in depth the issues you might encounter on the server side. GWT on the other side has got some new stuff: And for all those of us who hate having to load and reload static things over and over again from the server, here’s JSOC (JavaScript Object Cache):
The JSOC framework is a a pluggable, extensible, open source client-side caching framework for Web 2.0 applications. JSOC offers Web developers a straightforward way to perform common caching techniques (add, replace, remove, flush, etc.) inside any JavaScript-enabled browser. Since JSOC is a standalone JavaScript module, incorporating JSOC into a Web development project is a matter of including a script reference, and working with common caching methods. Low-level methods are contained in the JSOC JavaScript module so that developers can focus on the Web development task at hand.
Fancy some nice effects for your application? Then take a look at the JavaScript Particle Engine by Jason Harwig (the post includes a fully functional version of the code). It’s cool, but I simply can’t see where it might be usefull, so until somebod proves me wrong I’ll just put it into the “Proof-of-Concept” drawer :D Also there were plenty of releases: Ok I think this should be enough for now, I’ll cover the rest in some more detail later :)
  • Share/Bookmark

Optimizing Page Load Time

Aaron Hopkins of Google has released an article on Optimizing Page Load Time which came out of his experience optimizing page load times for a high-profile Ajax application. Clearly Google developers are along the best known ones in the Web 2.0 movement and the tips Aaron gives might just squeeze out the last few milliseconds from your application and improve the user experience. He makes a really extensive discussion on both problem sources and their solutions:
  • Turn on HTTP keepalives for external objects. Otherwise you add an extra round-trip for every HTTP request. If you are worried about hitting global server connection limits, set the keepalive timeout to something short, like 5-10 seconds. Also look into serving your static content from a different webserver than your dynamic content. Having thousands of connections open to a stripped down static file webserver can happen in like 10 megs of RAM total, whereas your main webserver might easily eat 10 megs of RAM per connection.

  • Load fewer external objects. Figure out how to globally reference the same one or two javascript files and one or two external stylesheets instead of many; try preprocessing them when you publish them. If your UI uses dozens of tiny GIFs all over the place, consider switching to CSS, which tends to not need so many of these.

  • If your users regularly load a dozen or more uncached or uncacheable objects per page, consider evenly spreading those objects over four hostnames. This usually means your users can have 4x as many outstanding connections to you. Without HTTP pipelining, this results in their average latency dropping to about 1/4 of what it was before.

    When you generate a page, evenly spreading your images over four hostnames is most easily done with a hash function, like MD5. Rather than having all <img> tags load objects from http://static.example.com/, create four hostnames (e.g. static0.example.com, static1.example.com, static2.example.com, static3.example.com) and use two bits from an MD5 of the image path to choose which of the four hosts you reference in the <img> tag. Make sure all pages consistently reference the same hostname for the same image URL, or you’ll end up defeating caching.

    Beware that each additional hostname adds the overhead of an extra DNS lookup and an extra TCP three-way handshake. If your users have pipelining enabled or a given page loads fewer than around a dozen objects, they will see no benefit from the increased concurrency and the site may actually load more slowly. The benefits only become apparent on pages with larger numbers of objects. Be sure to measure the difference seen by your users if you implement this.

  • Possibly the best thing you can do to speed up pages for repeat visitors is to allow static images, stylesheets, and javascript to be unconditionally cached by the browser. This won’t help the first page load for a new user, but can substantially speed up subsequent ones.

    Set an Expires header on everything you can, with a date days or even months into the future. This tells the browser it is okay to not revalidate on every request, which can add latency of at least one round-trip per object per page load for no reason.

    Instead of relying on the browser to revalidate its cache, if you change an object, change its URL. One simple way to do this for static objects if you have staged pushes is to have the push process create a new directory named by the build number, and teach your site to always reference objects out of the current build’s base URL. (Instead of <img src=”http://example.com/logo.gif”> you’d use <img src=”http://example.com/build/1234/logo.gif”>. When you do another build next week, all references change to <img src=”http://example.com/build/1235/logo.gif”>.) This also nicely solves problems with browsers sometimes caching things longer than they should – since the URL changed, they think it is a completely different object.

    If you conditionally gzip HTML, javascript, or CSS, you probably want to add a “Cache-Control: private” if you set an Expires header. This will prevent problems with caching by proxies that won’t understand that your gzipped content can’t be served to everyone. (The Vary header was designed to do this more elegantly, but you can’t use it because of IE brokenness.)

    For anything where you always serve the exact same content when given the same URL (e.g. static images), add “Cache-Control: public” to give proxies explicit permission to cache the result and serve it to different users. If a local cache has the content, it is likely to have much less latency than you; why not let it serve your static objects if it can?

    Avoid the use of query params in image URLs, etc. At least the Squid cache refuses to cache any URL containing a question mark by default. I’ve heard rumors that other things won’t cache those URLs at all, but I don’t have more information.

  • On pages where your users are often sent the exact same content over and over, such as your home page or RSS feeds, implementing conditional GETs can substantially improve response time and save server load and bandwidth in cases where the page hasn’t changed.

    When serving a static files (including HTML) off of disk, most webservers will generate Last-Modified and/or ETag reply headers for you and make use of the corresponding If-Modified-Since and/or If-None-Match mechanisms on requests. But as soon as you add server-side includes, dynamic templating, or have code generating your content as it is served, you are usually on your own to implement these.

    The idea is pretty simple: When you generate a page, you give the browser a little extra information about exactly what was on the page you sent. When the browser asks for the same page again, it gives you this information back. If it matches what you were going to send, you know that the browser already has a copy and send a much smaller 304 (Not Modified) reply instead of the contents of the page again. And if you are clever about what information you include in an ETag, you can usually skip the most expensive database queries that would’ve gone into generating the page.

  • Minimize HTTP request size. Often cookies are set domain-wide, which means they are also unnecessarily sent by the browser with every image request from within that domain. What might’ve been a 400 byte request for an image could easily turn into 1000 bytes or more once you add the cookie headers. If you have a lot of uncached or uncacheable objects per page and big, domain-wide cookies, consider using a separate domain to host static content, and be sure to never set any cookies in it.

  • Minimize HTTP response size by enabling gzip compression for HTML and XML for browsers that support it. For example, the 17k document you are reading takes 90ms of the full downstream bandwidth of a user on 1.5Mbit DSL. Or it will take 37ms when compressed to 6.8k. That’s 53ms off of the full page load time for a simple change. If your HTML is bigger and more redundant, you’ll see an even greater improvement.

    If you are brave, you could also try to figure out which set of browsers will handle compressed Javascript properly. (Hint: IE4 through IE6 asks for its javascript compressed, then breaks badly if you send it that way.) Or look into Javascript obfuscators that strip out whitespace, comments, etc and usually get it down to 1/3 to 1/2 its original size.

  • Consider locating your small objects (or a mirror or cache of them) closer to your users in terms of network latency. For larger sites with a global reach, either use a commercial Content Delivery Network, or add a colo within 50ms of 80% of your users and use one of the many available methods for routing user requests to your colo nearest them.

  • Regularly use your site from a realistic net connection. Convincing the web developers on my project to use a “slow proxy” that simulates bad DSL in New Zealand (768Kbit down, 128Kbit up, 250ms RTT, 1% packet loss) rather than the gig ethernet a few milliseconds from the servers in the U.S. was a huge win. We found and fixed a number of usability and functional problems very quickly.

    To implement the slow proxy, I used the netem and HTB kernel modules available in the Linux 2.6 kernel, both of which are set up with the tc command line tool. These offer the most accurate simulation I could find, but are definitely not for the faint of heart. I’ve not used them, but supposedly Tamper Data for Firefox, Fiddler for Windows, and Charles for OSX can all rate-limit and are probably easier to set up, but they may not simulate latency properly.

  • Use Google’s Load Time Analyzer extension for Firefox from a realistic net connection to see a graphical timeline of what it is doing during a page load. This shows where Firefox has to wait for one HTTP request to complete before starting the next one and how page load time increases with each object loaded. The Tamper Data extension can offer similar data in less easy to interpret form. And the Safari team offers a tip on a hidden feature in their browser that offers some timing data too.

    Or if you are familiar with the HTTP protocol and TCP/IP at the packet level, you can watch what is going on using tcpdump, ngrep, or ethereal. These tools are indispensible for all sorts of network debugging.

  • (Optional) Petition browser vendors to turn on HTTP pipelining by default on new browsers. Doing so will remove some of the need for these tricks and make much of the web feel much faster for the average user. (Firefox has this disabled supposedly because some proxies, some load balancers, and some versions of IIS choke on pipelined requests. But Opera has found sufficient workarounds to enable pipelining by default. Why can’t other browsers do similarly?)

The last tip in my opinion is not a really good one, Browser developers will most likely just ignore you, and you wont be able to change the world. For the full analysis, with graphics and the full discussion please see the entry by Aaron, it’s definitely one of the best readings in the last months, with all the technical details :)
[via Ajaxian]
  • Share/Bookmark