Safari saves video to drive even in private browsing mode

Discussion in 'OS X Mountain Lion (10.8)' started by junkster, Oct 21, 2012.

  1. junkster macrumors regular

    Nov 6, 2006
    Clear Safari's cache and start private browsing mode. Go to YouTube and watch a few videos. You don't have to watch the whole thing, just until the entire video is buffered.

    Now go to the "/var/folders" directory, either via the Terminal or the Go To Folder option in Finder. There are a couple of layers of folders with random names, but search around until you find a folder with Safari in the name, then go in there.

    What I've found are entire youtube videos saved to disk. Privacy issues aside, Safari is writing gigabytes of video to my SSD for absolutely no reason.
  2. GGJstudios macrumors Westmere


    May 16, 2008
    Private Browsing stops Safari from storing cookies or history, but it doesn't stop it from downloading data from websites you visit. It has to download data in order to display websites properly. That's normal. When you've finished browsing, empty your cache.
  3. junkster thread starter macrumors regular

    Nov 6, 2006
    I think you're missing the point, GGJstudios. Of course Safari has to download data in private browsing mode. But it does not need to write it to disk.

    And on write-limited SSDs, is there really a reason for storing an entire video that you watched part of and will never watch again to SSD? No. Just buffer it to RAM and that's that.
  4. GGJstudios macrumors Westmere


    May 16, 2008
    Downloading IS writing to disk. Where else would it download to? Safari doesn't download anything to RAM. That's not the purpose of RAM.
  5. junkster thread starter macrumors regular

    Nov 6, 2006
    Video, like any network traffic, is simply a stream of data coming over a TCP/IP socket. Writing that data to disk is not an intrinsic part of the process; it's something the application engineer has to write code to do. In fact on iOS videos are streamed directly to RAM with no disk writes involved.

    There's no need for the Safari engineers to save out 50-100MB videos to a limited-write SSD. Period. There's lots more RAM on Mac compared to iOS, too.
  6. GGJstudios macrumors Westmere


    May 16, 2008
    I just stated how it works. They're not going to rewrite Safari because a user thinks they should. As I said, all you have to do is empty the cache after browsing. It's really not a problem. You're not going to wear out your SSD anytime soon, simply by browsing and streaming.
  7. elistan macrumors 6502a

    Jun 30, 2007
    Denver/Boulder, CO
    YouTube uses Flash to display videos. Perhaps it's not Safari saving data to disk, but instead it's the Flash plugin?
  8. kaffee macrumors newbie

    Dec 26, 2012
    When on a session in Safari (i.e. viewing videos, and not just on YouTube), the cached data is saved in:

    (user/Home drive)/private/var/folders/...​

    I'm still on Leopard and if you can't find this particular ".../var/folders/..." folder, note that it is within "private" which, as in my case, is grayed out and normally inaccessible via Finder.

    So from "private," mine creates yet another subfolder:

    (user/Home drive)/private/var/folders/tg/(then a temp folder)/-Tmp-/(then several folders, one named DDMCache)/~.avi (or whatever video file)​


    (user/Home drive)/private/var/folders/tg/(then a temp folder)/-Caches-/(several Safari files and some folders)/​

    but where no cached video files are found.

    After the movie has been fully cached, I move the ~.avi (or any cached video file) under "-Tmp-" to my/any appropriate folder.

    Hope this helps.

  9. smellalot macrumors 6502

    Dec 6, 2011
    You're skipping over the part where Safari's Private Browsing should empty the cache for you...

    To heat up this discussion: does Chrome empty the cache for you?

Share This Page