The Firefox ‘Work Offline’ Bug

January 13, 2010

Here’s a maddening problem I observed while using Firefox 3.5 for PHP development. (My laptop dev environment consists of Windows 7, PHP 5.3, MySQL 5 and Apache 2.2.)

The Problem

Without warning, Firefox suddenly stopped showing the changes I was making to my PHP code. Refreshes (including hard refreshes) simply resulted in the last cached version of the page being redisplayed, regardless what changes I had made to my source code.

The Cause

I discovered this problem during a tropical storm, while the electricity (and therefore wi-fi) was going on and off. (Thank goodness for extra laptop batteries!) What was happening was that Firefox responded to interrupted internet access by silently switching to ‘Offine Mode’. When it does this, Firefox insists on re-serving the last cached version of a page without attempting to reload it, even if the page comes from localhost.

The fact that it does this silently is the reason I characterize this behavior as a bug.

The Solution

Click File and uncheck the Work Offline option, and you should be able to quit pulling your hair out and get back to work. Unless you’re here in Puerto Viejo, Costa Rica, in which case you should just go for a walk down the beach instead.

Update

My friend and genius LAMP developer Michael Henretty found in a few minutes what eluded me all day: this thread on mozilla.com.

The trick is to go to about:config, find browser.offline-apps.notify and set it to false.

Thanks, Mike.

Comments

Comments are closed.

Spawn PHP Framework

Learn all about installing and working with this easy-to-use MVC framework.

Continue reading »

Coming Soon: Scaveng

Scaveng is a scriptable web scraper. Stay tuned for more.