Archive from June, 2009
Jun 30, 2009 - Tutorials    11 Comments

Manually solve ‘empty cache after crash’ problem in Firefox

The Background:

Imagine that you have 400+ MB of Firefox’s cache brimming with websites that you visit regularly. If Windows crashes or the computer is not shut down properly while Firefox is still running, you WILL lose that cached data when you start Firefox again. Which basically means that every site you visit now will be downloaded all over again, since the cached files are no longer valid. If your computer has a nasty habit of crashing every now and then, or you run your computer in an environment devoid of a UPS and susceptible to frequent power outages, you will end up wasting a lot of bandwidth. And God help you if you are on a limited data transfer plan.

Why Does This Happen?

When you start Firefox it marks the cache as ‘dirty’ and when you close Firefox, the dirty bit is removed. So when Firefox is not properly closed, the cache remains tagged as ‘dirty’. Firefox checks the status of this bit on startup and when it sees the ‘dirty’ bit, it invalidates the entire cache and the cache is rebuilt from scratch, beginning from this session.

I have been plagued by this problem for a while now. Searching the Internet brought up vague results and recommendations to install an extension (which I haven’t been able to get installed till now). Then a few days ago I stumbled upon a post which actually explained the entire concept behind this behaviour. After reading this, I decided to write a tutorial on it.

Let’s Get Our Hands Dirty:

  • Frhed is a small, free and functional hex-editor that we will use for this tutorial. Download and install Frhed.
Download Frhed

Download Frhed

  • Now we need to locate the folder where Firefox has stored its cache. I am supposing that Windows is installed on the ‘C’ drive and that only 1 user-profile is being used in Firefox.
  • If you are using Windows XP, navigate to-

C:\Documents and Settings\<UserName>\Local Settings\Mozilla\Firefox\Profiles.

  • On Vista/Windows 7 machines, go to-

C:\Users\<UserName>\Local Settings\Mozilla\Firefox\Profiles.

  • Look for a folder that has the word ‘.default’ suffixed to it.
  • In that folder you will find a directory named ‘cache’. Open it.
  • Now look for a file named _CACHE_MAP_ in this folder.
Path to Firefox's cache

Path to Firefox's cache

  • Open this file with Frhed. It should look something like this:

_CACHE_MAP_ in Frhed

_CACHE_MAP_ in Frhed

  • Now in Frhed, go to the ‘Edit->Go To’ option. Type 15 and press Enter.
  • Why 15? Because the dirty bit is stored at that position in the _CACHE_MAP_ file.
  • If Firefox is currently running or was not closed properly, the value at this position will be 01.
The bits to be altered

The bits to be altered

  • As you can see in the image, the value at this position is 01, which indicates that the cache is currently marked as dirty. To change this, simply replace the 01 with 00 and save the file.
  • Now start Firefox and try opening any of the sites you regularly visit. They should open normally without the whole content being downloaded off the server, which is exactly what we wanted. :)
  • To make things even simpler, I’d suggest that you create a shortcut to the _CACHE_MAP_ file on your desktop so that you don’t have to go through the maze of folders to reach it again. ;)

So there you have it. By investing no more than a couple of minutes every time Firefox is not closed properly, you can save yourself a lot of bandwidth and time. :D

Popularity: 38% [?]

Jun 22, 2009 - Opinion    4 Comments

What can you do in 15 seconds?

You are at one of the busiest intersections in the city. The timer is showing 15 seconds for the light to go green. What do you do? Select from the folowing:

  1. Ignore your surroundings and wait for the light to go green
  2. Survey your fellow motorists and pass the time until the light goes green
  3. Hum your favourite song
  4. Make a mental note of the things you need to do as soon as you reach home

What, none of the above? Then how about the following?

  1. Weave your way between the stationary vehicles while ogling at the females of the species
  2. Keep honking and try to cross the intersection while motorists are still coming from one direction
  3. Almost get hit by a bike coming from the aforementioned side
  4. Then listen to a torrent of abuses from the said biker
  5. Still try to move ahead and almost get run over by an SUV
  6. And just when you feel you’ve made it, get caught by the traffic policemen

I know what I would prefer. And it doesn’t involve performing an utterly moronic and needless act trying to look cool. Sadly, that is not what a lot of boneheads on bikes would do. ‘Waiting at the traffic lights ain’t cool’, they seem to think.

Well, acting like idiots and getting caught by the cops ain’t cool either, fellas. And neither is getting your brains splattered all over the road. :|

Popularity: 4% [?]

Jun 18, 2009 - Site Updates    4 Comments

So what has changed?

Alright, I said I would list out the changes and why they were made. So here they are, in a neat list:

  • The site is no longer ‘just a blog’. I wanted to make it a platform for all my future endeavours. The scope for expansion through a blog is limited, in my opinion.
  • There are 3 additional sections now, namely Art, Digital Art and Photography. Earlier I used to publish all of my creations in posts under a category. But this time I decided that it would be better to allocate a separate page where I can showcase them. It could have been possible through WordPress, but I decided against it.
  • The site is no longer based entirely on WordPress. I wanted to design something that had my unique imprint on it. Designing a WordPress theme was too cumbersome and hardly left a lot of room for experimentation.
  • The blog now uses a custom theme, matching perfectly with the look of the rest of the site. That was probably the second most difficult part.
  • The most difficult part was deciding on the layout, colours and such. I borrowed ideas and resources from other websites that I had seen and admired, tweaked them, added lots of my own inputs and conjured up something that looks like this.

And most importantly, now I can call this site another one of my own creations. It’s an altogether different feeling to make something from scratch and then watch it running flawlessly (almost). :D

And before I forget, I’ve also lost most of the links in my blogroll so if any of you were on my list, do tell me so I can add you back! And if you were not on my list earlier, you can be now! :)

Oh, and another thing. The site is still in BETA, so if you spot any odd behaviour or if something looks out of place, do notify me through the comments or through e-mail.

Cheers! :)

Popularity: 3% [?]

Pages:12»