Archive » General

Time-based expiry of the Rails Page Cache

September 22nd, 2007 by Nikhil

Rails page caching is a great way to cope with a large number of hits. However, it’s hard to use in a typical web application cos parts of the page need to be personalized.

Even then, there are quite a few use cases where one could do a page cache for partials! Especially when using AJAX, the rendered partial at times is the same for all users. For example, when showing “related content”, the content displayed is related to the current article and not the viewer. In such a case one could use a page cache.

The only problem now is expiring the page cache. Computing “related content” is usually a time intensive operation when calculated from the other way, i.e. new content is added, so expire all pages to which it might be related to (so that it will appear as their related content the next time the partial is generated). Thus expiring the cache using sweepers isn’t an option. In such cases, a time based expiry works very well.

For this I have written a simple script using which you can specify which directory should be purged and at what time intervals.

Just download the cachedel script and drop it into your RAILS_ROOT/scripts directory

Then configure your cron to invoke it periodically.

Example:

0 * * * * /var/www/apps/c2w_portal/current/script/cachedel "blogs" 120This will invoke the cachedel script every hour and the script will delete all files in the blogs cache that are older than 2 hours

Commoditization of Software Engineering

November 22nd, 2006 by Nikhil

As any practice matures, it’s practitioners try to find ways to drive up efficiency, quality and reduce risks and costs. Generally speaking, this leads to better and cheaper products. However, IT services companies seem to be taking this concept a bit too far.

Most tech organizations evolve processes that try to be predictable, cost effective and at the same time less dependent on people. The process relies more on roles such that any person can be cast into it. The processes warrant that people be replaceable since they aren’t predicable. The process maps software development into and assembly line. (more…)

Self-Centered Software Design

November 13th, 2006 by Nikhil

Dog and CatIt’s well known that most software developers hate providing support, training end users, writing documentation, basically anything that doesn’t involve programming. But when you force them to do what they hate the most, you can expect dramatic improvements in the software that they create.
It’s kinda like If you are a dog who makes cat food, let the cats come to you if they need to throw-up.
(more…)

Microsoft’s Desktop Irony

November 10th, 2006 by Nikhil

Steve Ballmer is currently in India and has made the headlines of todays Economic Times. Apart from the usual Google/Oracle/Apple/IBM bashing, he vehemently defends the desktop. That’s logical since Microsoft’s main moolah generating engine is powered by the desktop. Isn’t it then ironic, that the one innovative thing to come out of Microsoft - XMLHTTPRequest (backbone of AJAX), is directly aimed at reducing the desktop to merely a device sporting a terminal, keyboard and mouse. (more…)

Why we don’t have any customers

October 28th, 2006 by Rajesh

We don’t have customers. We have clients. We only want clients and not customers.

Don’t customer and client mean the same? It doesn’t to us because there is a fundamental and practical difference between the two. This understanding that there is a difference between a Customer and a Client forms the foundation of our business deals and guides us in our business. Let me explain further our philosophy to have ONLY Clients?
(more…)