Results 1 to 7 of 7

Thread: How To: Prevent Chrome (or any application) from caching to your SSD using Junctions

  1. #1
    The Voice of Reason
    Join Date
    Oct 2003
    Location
    Lincoln, NE
    Posts
    9,220

    Post How To: Prevent Chrome (or any application) from caching to your SSD using Junctions

    Like the Chrome browser, but tired of wondering why Google doesn't let you disable or even move the disk cache? Worried about excess writes to your precious solid-state drive? Unlike Opera and Firefox, the settings for Chrome are very limited. For those of you using the Chrome browser with an SSD, I have a solution.

    Chrome is at version 4 now, and there is still no way to modify the cache settings. This seems to be true for other Google products as well, since I have found no way to change cache location in Google Earth either. This procedure will work for any program you want to redirect temp or cache files from, and has other uses as well.

    I have been using symbolic links to get around the problem. I created a directory for the Chrome cache on a separate drive (D). Then I set up a symbolic link from the usual Chrome cache directory to this new cache directory I created. As a result, Chrome continues to store cache files in its default location, but because of the symbolic link, the files are actually stored on a whole different drive and location. Still no way to control cache size, but at least, changing the location helps.

    Here's how to do it on Vista or Windows 7. If you are using XP, read this section then follow the additional instructions which follow.

    1. Shut down Chrome. Open Task Manager and make sure that the Chrome process is not running.
    2. Choose where you want the cache to be and make a directory there for it. For example, in my case, I made an alternate user directory on drive D (my WD 6400AAKS) like so: D:\Users\username\Chrome User Data
    3. Find the default Chrome Cache directory. In Vista or Windows 7, it is C:\Users\username\AppData\Local\Google\Chrome\User Data. It may vary on XP. Make sure you replace username with your actual user name.
    4. Copy the entire "User Data" directory to the new location. In my case, it went from C:\Users\username\AppData\Local\Google\Chrome\User Data to D:\Users\username\Chrome User Data
    5. Delete the original User Data folder.
    6. Open an elevated command prompt (right click command prompt and click "Run as Administrator". In the command window, paste the following, including the parenthesis:

    mklink /J “C:\Users\username\AppData\Local\Google\Chrome\Use r Data” “D:\Users\username\Chrome User Data

    Make sure you replace username with your actual username, and replace D:\Users\username\Chrome User Data with the actual path to the new location of your User Data directory. I find it easier to paste it into notepad and edit it before copying and pasting into a command prompt.

    That's it. This will create a symbolic link from the original location of the User Data directory to the new location. Chrome will continue to dump files in its default location, but since you created a "junction" type symbolic link (that's what the /J flag is for in the mklink command), Chrome remains unaware that it's following a symbolic link, and continues to work as usual. However, the files now go to the new cache location.

    If you are using XP or Windows 2000, note that the mklink command is not available in the command shell. Both XP and Windows 2000 do in fact support junction type symbolic links, but the mklink command is missing. So if you use either of these two operating systems, you will need to download a utility to make the symbolic links.

    Microsoft has a utility for this purpose available for download at their Technet site. It's called "Junction" and you can download it at:http://technet.microsoft.com/en-us/s.../bb896768.aspx.

    You would then follow the procedure as described for Vista and Windows 7, but you would use the "junction" command instead of "mklink", like so:

    junction "C:\Users\username\AppData\Local\Google\Chrome\Use r Data" “D:\Users\username\Chrome User Data”

    For those not familiar with MS-DOS, this needs to be input from the directory that the Junction Tool resides. Make sure you replace the paths with the actual paths to your original and new locations for the User Data directory.

    As an extra, I also did this with the Users/Public folders that Windows uses to hold files that any user account can access. I did the following:

    1. Copy the public folders to their new location. Not move - Windows gets screwy if you try to move them.
    2. Delete the original folders that you copied
    3. Paste the following code:

    mklink /J "C:\Users\Public\Documents" "D:\Users\Public\Documents"
    mklink /J "C:\Users\Public\Downloads" "D:\Users\Public\Downloads"
    mklink /J "C:\Users\Public\Music" "D:\Users\Public\Music"
    mklink /J "C:\Users\Public\Pictures" "D:\Users\Public\Pictures"
    mklink /J "C:\Users\Public\Recorded TV" "D:\Users\Public\Recorded TV"
    mklink /J "C:\Users\Public\Videos" "D:\Users\Public\Videos"

    Now any time someone puts a 4GB movie file in the Public Videos folder, it actually gets sent to D:, and not your SSD! There is no way they can screw this up unless they put it in the wrong place to start.

    For your regular user folders, just right click on them and under Properties, change the directory on the "Location" tab and Windows does the work for you. I simply change it from C to D. I do this for the same folders as listed above.

    Any time a program tries to interact with any of these folders, it serves like a redirect and the program is not aware of it. You can use this for anything. Especially useful for programs that don't let you modify their save, cache, or any other directories.

    Hope some people find this useful!
    Last edited by Soulburner; 10-28-2010 at 09:14 AM.
    Windows 7 + SSD:
    Mode: AHCI, default Microsoft driver or latest Intel RST
    Defrag: Off
    Hibernation: Off (use Sleep mode, recommend a UPS)
    Indexing: On (it only indexes a few locations, not your whole system unless you tell it to)
    Page File: On (set to the minimum of 16MB if you have a large amount of RAM, disabling not recommended)
    Prefetch: On
    Superfetch: On (RAM is always faster than an SSD - use it)
    System Restore: Off (with regular backups)
    Browser Cache: RAM Only, Disk Cache Off (How to with Chrome)
    Documents, Music, Pictures, Videos, Downloads to HDD (Public Libraries too, see above link about junctions)
    UAC: On!

  2. #2
    The Voice of Reason
    Join Date
    Oct 2003
    Location
    Lincoln, NE
    Posts
    9,220
    I'm not sure why, but the forum seems to be adding a space in almost every occurence of \User Data. When I try to edit it, it looks normal. Anyone else see this? Copying and pasting it into Notepad includes the space which is not there when I try to edit the post.

    Windows 7 + SSD:
    Mode: AHCI, default Microsoft driver or latest Intel RST
    Defrag: Off
    Hibernation: Off (use Sleep mode, recommend a UPS)
    Indexing: On (it only indexes a few locations, not your whole system unless you tell it to)
    Page File: On (set to the minimum of 16MB if you have a large amount of RAM, disabling not recommended)
    Prefetch: On
    Superfetch: On (RAM is always faster than an SSD - use it)
    System Restore: Off (with regular backups)
    Browser Cache: RAM Only, Disk Cache Off (How to with Chrome)
    Documents, Music, Pictures, Videos, Downloads to HDD (Public Libraries too, see above link about junctions)
    UAC: On!

  3. #3
    Registered User
    Join Date
    Sep 2006
    Location
    Melbourne, Australia
    Posts
    19
    Yep appears to be some formatting issue.

    try quoting your OP and editing then cut and paste it into the 1st post?
    Attached Images Attached Images

  4. #4
    Xtreme Enthusiast
    Join Date
    Feb 2010
    Posts
    693
    Great post and will do until google finally adds this option.
    slowpoke:
    mm ascension
    gigabyte x58a-ud7
    980x@4.4ghz (29x152) 1.392 vcore 24/7
    corsair dominator gt 6gb 1824mhz 7-7-7-19
    2xEVGA GTX TITAN
    os: Crucial C300 256GB 3R0 on Intel ICH10R
    storage: samsung 2tb f3
    cooling:
    loop1: mcp350>pa120.4>ek supreme hf
    loop2: mcp355>2xpa120.3>>ek nb/sb
    22x scythe s-flex "F"

  5. #5
    The Voice of Reason
    Join Date
    Oct 2003
    Location
    Lincoln, NE
    Posts
    9,220
    Quote Originally Posted by Soulburner View Post
    2. Choose where you want the cache to be and make a directory there for it. For example, in my case, I made a directory on drive D (my WD 6400AAKS) like so: D:\Chrome User Data
    3. Find the default Chrome Cache directory. In Windows 7, it is C:\Users\{username}\AppData\Local\Google\Chrome\Us er Data\. It may vary on XP or Vista. Make sure you replace {username} with your actual user name.
    4. Move the entire "User Data" directory to the new location. In my case, it went from C:\Users\{username}\AppData\Local\Google\Chrome\Us er Data\ to D:\Chrome User Data
    5. Create a new folder called "User Data", where the old one used to be. Leave it empty.
    6. Open an elevated command prompt (right click command prompt and click "Run as Administrator". In the command window, type:
    mklink /J “C:\Users\{username}\AppData\Local\Google\Chrome\U ser Data” “D:\Chrome User Data”
    Make sure you replace {username} with your actual username, and replace D:\Chrome User Data with the actual path to the new location of your User Data directory.
    testing

    Nope doesn't work...looked fine before I hit post.

    Anyone have an idea why these spaces are being inserted?
    Last edited by Soulburner; 05-19-2010 at 05:14 AM.
    Windows 7 + SSD:
    Mode: AHCI, default Microsoft driver or latest Intel RST
    Defrag: Off
    Hibernation: Off (use Sleep mode, recommend a UPS)
    Indexing: On (it only indexes a few locations, not your whole system unless you tell it to)
    Page File: On (set to the minimum of 16MB if you have a large amount of RAM, disabling not recommended)
    Prefetch: On
    Superfetch: On (RAM is always faster than an SSD - use it)
    System Restore: Off (with regular backups)
    Browser Cache: RAM Only, Disk Cache Off (How to with Chrome)
    Documents, Music, Pictures, Videos, Downloads to HDD (Public Libraries too, see above link about junctions)
    UAC: On!

  6. #6
    The Voice of Reason
    Join Date
    Oct 2003
    Location
    Lincoln, NE
    Posts
    9,220
    Updated and revised
    Windows 7 + SSD:
    Mode: AHCI, default Microsoft driver or latest Intel RST
    Defrag: Off
    Hibernation: Off (use Sleep mode, recommend a UPS)
    Indexing: On (it only indexes a few locations, not your whole system unless you tell it to)
    Page File: On (set to the minimum of 16MB if you have a large amount of RAM, disabling not recommended)
    Prefetch: On
    Superfetch: On (RAM is always faster than an SSD - use it)
    System Restore: Off (with regular backups)
    Browser Cache: RAM Only, Disk Cache Off (How to with Chrome)
    Documents, Music, Pictures, Videos, Downloads to HDD (Public Libraries too, see above link about junctions)
    UAC: On!

  7. #7
    Xtreme Member
    Join Date
    Sep 2008
    Posts
    375
    Has Google added it's own option yet, or do I still use this?

    Also,

    1) Does this junction have any impact on browser responsiveness?
    2) I want to put Chrome's cache on a RAMDisk, is it OK if the RAMDisk is formatted in FAT32?
    3) How big does the disk need to be (is there a size limit on the Chrome cache)? I intend to use 2GB-4GB ramdisk.
    4) I don't want to have the RAMDisk image saved on each shut down and loaded on each boot due to slow downs. Is it OK is the Chrome cache is wiped on every shut down?

    In your sig:

    "Page File: On (set to the minimum of 16MB if you have a large amount of RAM, disabling not recommended)" - Why?
    Last edited by Skakruk; 04-21-2011 at 05:48 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •