How do you disable cache writes to disk?
-
If "--media-cache-dir" is no longer a switch for chromium browsers (as of May 2020), how can I disable caching to disk? I still have RAM to spare and don't want so many writes to my HDD.
In addition when I right click on vivaldi.exe I don't see "Properties window, find the field labelled "Target" " anywhere which is one of the steps from this superuser guide to disable cache:
-
@MindStateTrain You need to change the properties for the Start menu shortcut, not for vivaldi.exe.
-
@MindStateTrain Did you try the other solutions in that SU post, like using
--disk-cache-dir
or the extension?Most people would probably tell you to use a RAM disk:
https://www.howtogeek.com/171432/ram-disks-explained-what-they-are-and-why-you-probably-shouldnt-use-one/Some will probably also advise using
--disk-cache-size
but this is wrong - it's not a hard limit, it will not disable cache writes and will probably actually lead to even more cache writes.Hacky solution:
vivaldi.exe --disk-cache-dir=NUL
Extremely hacky solution:
- Close Vivaldi
- In Vivaldi profile dir delete the following dirs:
Cache
Code Cache
GPUCache
Service Worker
- Open cmd prompt as Admin and run the commands in the Vivaldi profile dir:
mklink /D "Cache" NUL
mklink /D "Code Cache" NUL
mklink /D "GPUCache" NUL
mklink /D "Service Worker" NUL
- This basically symlinks these directories to the non-existent NUL device.
- Service Worker is optional, but as these things are a pest and usually take up a lot of disk space you might as well do it.
- Will probably crash horribly at some point in time.
- Might run out of memory because it will use memory cache more (?)
- Obviously not supported and if this breaks something you're on your own pal.
None of these will completely disable writes to disk of course, there is for instance a lot of writes to TEMP for some reason while the browser is running, not sure what these are.
You could of course in theory map TEMP to a RAM disk as well, but it will probably explode your computer if the RAM disk is somehow disconnected during normal operation...
You can check if it works by using a tool like Process Monitor with the appropriate filters.
-
Hi,
Check also
chrome://flags/#turn-off-streaming-media-caching-always
--
"Off Topic Tip"
Follow the Signature's Backup | Reset link.
Take the opportunity to start a Backup plan and even create a Template Profile.
Windows 7 (x64)
Vivaldi Backup | Reset + Extra Steps -
@Pesala said in How do you disable cache writes to disk?:
@MindStateTrain You need to change the properties for the Start menu shortcut, not for vivaldi.exe.
Under the "security" tab I have three groups/users listed (SYSTEM, Username of PC, and Administrators) and I see the permissions like read, write, etc. What do I disable? Just write for all three?
To the others, great info and I'll report back what happens when I disable streaming media caching always.
-
@MindStateTrain I have no idea; I am just saying that the linked superuser tip says to edit the shortcut.
-
There,
users
, do not modify.
Isn't necessary and would generate problems to open V of don't know what it's been doing.Check this Guide,
Switches
, and replace the parameters with the--disk-cache-dir=
Whatever choosen version -
@MindStateTrain , you also can use the Site Bleacher extension as workarround. It remove automatically cookies, local storages, IndexedDBs, service workers, cache storages, filesystems and webSQLs from all not whitelisted sites.
https://github.com/wooque/site-bleacher -
@MindStateTrain Why are you looking at the Security tab for the folders? You should not touch those unless you know what you're doing and no-one's told you to change that.
For changing command line arguments you need to change the Target property of the link/shortcut you use to start Vivaldi.
@Zalex108 There is no
--disk-cache-dir=N
argument, the user don't need even more confusion than they already have -
It's just the example.
One of the users posted on the linked Topic as N means the quantity.
Then anyone choose whether Null, or whatever.Even seems that Null just works for Nix.
-
@Zalex108 , I think there are surely different script-level solutions in the Vivaldi directory, but this is Comanche territory for inexperienced users.
I think the Site Bleacher (OpenSource) script can be included in Vivaldi in the Privacy Settings, this would be the best solution. -
@Zalex108 You originally wrote
--disk-cache=N
and I was going to post that but you changed itBut using
--disk-cache-dir=N
will probably lead to creating a directory namedN
and writing cache thereNUL
is a special null device on Windows, like/dev/null
on Linux, it does not mean zero.
https://ss64.com/nt/nul.html
https://en.wikipedia.org/wiki/Null_device -
That looks fine, the problem is that, the user here wants to block the writing, and those Extensions just cleans once the write is done.
So here, this doesn't match.
--
Where on security are you referring?Official?Ok,
On V Settings.Yes,
Would be good. -
Yes,
During the posting I've corrected it, but the N as quantity or as Drive letter would be whatever the user wants or doesn't exist.
Just was the example, I could add that too to avoid confusions.
Thanks
-
Yes,
Just read the post again, the user just mentioned it as works on Nix, I've misunderstood to "Just works on Nix"
I'll update.
-
@Zalex108 Yes, one of the SU users writes: "The most effective way to disable caching in Chrome is to provide it with a cache directory that does not exist."
So they use
Z:\
as an example. Problem with this approach is that- User will have to choose a drive that don't exist on their system
- The process attempting to write will receive a lot of errors when trying.
Using device
NUL
will fool the process into thinking write was successful.And using just
N
will create a dir named that and write cache to it like normal.
On *nix the user should use/dev/null
. -
Post updated
-
@Pathduck , this has a small problem, it prevents the registration of all the sites and not only the sites where it does not interest.
That is why I mentioned this extension, as workarround, although it only removes the data once downloaded as @Zalex108 says, it avoids the accumulation of this data, which obviously saves space and avoids having the data at hand later. The data remains only temporarily, while you remain on the site in question and allows you to save the data of interest, for example from this forum -
It would be mixed:
- Use that Extension
- Delete unwanted sites Data
- Mark Cache folders as "Read Only"
- The Data will be accessible but no more writes from temp sites
--
Repeat for new long standing sites
-
@Catweazle Sure, but the OP wanted a solution to avoid cache writes to disk. Some users have the (IMO mistaken) notion that avoiding writes to their SSD will lengthen its lifespan. Which might be true to a certain point but I honestly don't think it will matter much, newer SSDs have features to deal with it.
But if users ask for solution, we give it to them no matter if it's a generally bad idea to do so
I think we've scared them away by now