Wednesday, July 20, 2005 9:22 AM
windowsmobile
Beating up your PPC with the web...
In my recent Persistent Storage entries I talked about the issue that if you do extensive web browsing, you could write a ton of files to your flash and shorten its life. (Gerard, sorry I mischaracterized your question. I did understand you, but it was easier to explain "browsing 1000 web pages a day" than "browsing 100 web pages a day, each with 10 items on it" etc. Even though everyone reading can do the math, "1000" just hits home better than "100 times 10.")
I gave one solution (disabling the cache) and promised to give a better one. Unfortunately, I'm only going to be able to go about halfway on that promise. I wanted to show people how to move their temporary internet files to a ramdisk. But I'm finding that we're just not there yet in terms of ramdisks. I did some asking around and didn't find any readily accessible ones. (I didn't search heavily though. The day job gets in the way.) I suspect that, since PPC storage has been RAM based in the past, no one has seen a need to write a ramdisk yet. Maybe an enterprising ISV will take up the challenge now. We do have a fully tested ramdisk driver in our platform builder distribution (it's under \public\common\oak\drivers\block\ramdisk), but the day job definitely doesn't give me time to package that up into something end users could reasonably install.
So, what I'm going to do is tell you how to move your temporary internet files elsewhere. It's half the story, but it's better than nothing. If you move them to a storage card, then at least you'll only thrash that card. They're pretty cheap these days. And, to answer a question asked, yes, storage cards are wear leveled too. So, with a relatively big one, you've got a lot of web browsing to do before you write it to death.
Doing this is going to require editing the registry. It's definitely a power user sort of thing to do. But, then again, browsing enough web pages to make this a concern is a power user sort of thing as well. That said, I talked with the PIE lead and he's comfortable with me giving this information to you. For a different reason he uses this technique himself to move his cookies to a storage card. (By the nature of what we do, we frequently need to flash new builds on our devices. And doing that erases user storage. So he stores his cookies remotely in order to not lose them.) Incidentally, in talking with the PIE lead I suggested that he look into putting stuff in a ramdisk. It's an interesting idea, because it would improve PIE performance as well. We'll see where that goes in future versions. (But any changes would be down the road a ways.)
One more caveat before I give the registry key. Typical users, you don't need to do this. Typical flash blocks can be rewritten a million times (my 250,000 number was old), and it's wear leveled so that no one block is written over and over again. This is only a concern for people who do extensive web browsing on a daily basis.
The registry keys you want to change are under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders. (This is a new location for WM5. It was in a different location in WM 2003 SE.) You'll find three values there, one for the cache, one for the cookies, and one for history. You can move just the cache, or two of them, or all three. It's up to you. You'll find that they all currently point to \Windows\<more stuff>. I suggest just changing the \Windows\ part to \Storage Card\ and leaving the rest the same. That'll make it easy to put them back later if you want.
Change the key, close and reopen PIE, and it'll start using the new location. It'll create the directory if it doesn't exist. I tried this on one of my devices and it worked fine. If you eject the card, it'll just not cache files until you put the card back in. PIE will keep working.
Now, for the other half of the solution, if you find a ramdisk, install it and point the same key at wherever it's mounted. If I stumble across one, I'll post it here.
Mike Calligaro