• Whoops: that was a cute trick

    So there I was, finishing work on the cache management system for a super-secret new project, tracking down a couple of errant bugs, when I encounter one that refuses to go away.

    The bug had been the result of some bleary-eyed typing; I was able to fix it in-line. I reloaded the page, but the same warning message came back up, referencing the same line of code. What the heck? I've fixed it. I stare at it, frowning. Maybe if I glare at it, it will go away.

    No, it's definitely correct. So, I reload the page again, just in case there was too little time between the last upload and the last refresh. But it's still there, taunting me.

    I mutter something mean at my browser, blaming it for caching an old copy, error message and all. Close the tab, open a new one (which starts with a fresh cache), reload ... and it's still there.

    What? Did my code editor fail me? Did it only pretend to upload the file? Re-upload, refresh ... still the error is there.

    So I insert a blank line above the one with the error. The line number on the error message should increment by one -- but a quick reload later, and it's still the same stinkin' error message.

    Oh, wait. Yeah. That's right, I'm writing a server side cache manager.

    When the error message appeared the first time, the cache manager saved a copy of the output, and then every time I reloaded the page it gave me the cached version -- complete with a stale error message.

    It got a grin out of me, anyway.