Cache locations
-
My browser details at the end...
I have just designed a brand new backup system which backs up nightly and realised the enormous cache that Vivaldi has. There's a few of them. At one point the main portable folder of Vivaldi was a huge 1.2Gb.
So I am writing a script for it to clear the cache before backup and I have identified the locations of the caches.
What I would like help with is for someone to tell me that these are the only caches and they are safe to empty each night?
The ones I have are:
Vivaldi\User Data\GraphiteDawnCache
Vivaldi\User Data\GrShaderCache
Vivaldi\User Data\ShaderCache
Vivaldi\User Data\Default\Cache\Cache_Data
Vivaldi\User Data\Default\Code Cache\js
Vivaldi\User Data\Default\DawnCache
Vivaldi\User Data\Default\GPUCacheVivaldi 6.2.3105.58 (Stable channel) (64-bit)
Revision 160afb130e98d47754ca92d477dfe950a5c0b4c1
OS Windows 10 Version 22H2 (Build 19045.3516)
JavaScript V8 11.6.189.22
User Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36
Profile Path Vivaldi\User Data\Default
Variations Seed Type Null
Active Variations 5e3a236d-4113a79e -
@boristhemoggy Those look OK I guess. No idea about the GraphiteDawnCache what that even is but I'm assuming it's some kind of cache.
The ShaderCache stuff is likely GPU caches (compiled shaders).The
Service Worker
dir can get quite large as well, depending on the sites you visit and how they use SWs.
File System
can also get large and not cleaned up, again depending on the sites.But here's an idea - instead of writing a script to delete the content of these dirs, forcing you to close the browser before it does so, instead just exclude these directories from backup. A good backup program should have a feature to make exclusions for what to not back up.
-
@Pathduck I've never come across any backup program that can exclude only certain sub-folders from a folder, but writing the script file is easy and takes seconds to work, so I'm happy going down that road. (Although god knows why cache isn't cleared automatically at shutdown)
Where can I find Service worker and File system? There's no folders of that name? -
@boristhemoggy said in Cache locations:
Although god knows why cache isn't cleared automatically at shutdown
Because there's no reason to delete it?
It's called cache for a reasonWhere can I find Service worker and File system?
It should be in the profile folder. If not I guess you've not visited any sites that use Service Worker cache or the File System API.
-
Yeah but we should be able to limit the cache. Mines been over 600Mb before. That's mental
-
Thanks anyway I appreciate your time.
-
@boristhemoggy said in Cache locations:
That's mental
No, it's perfectly normal. Mine's about this:
401M Cache 295M Code Cache 552K DawnCache 5.6M GPUCache 3.0M Service Worker 681K File System
Some more reading for you:
https://gent.ilcore.com/2011/02/chromes-10-caches.html
https://www.thewindowsclub.com/change-chrome-cache-size-performance
https://peter.sh/experiments/chromium-command-line-switches/I've never seen the cache grow to more than a little over 1GB so there seems to be some limit there (percentage of available disk space?)
-
@Pathduck said in Cache locations:
https://www.thewindowsclub.com/change-chrome-cache-size-performance
Just a heads up... Setting the "cache-size" has been broken now for many months on Linux builds. I fooled around with it for a long time trying different values and double checking the syntax via searching the web. Nowadays I run a script every few weeks that deletes older entries which usually brings it back down to ~150mb on my system.
In looking at Vivaldi>About it appears to be in effect but looking at the System Log shows it didn't accept the entry and of course the cache grows much larger than the suggested entry
-
@lfisk said in Cache locations:
Just a heads up... Setting the "cache-size" has been broken now for many months on Linux builds.
Ok fair enough. Just remember the size is supposed to be in bytes.
But for me, I'm not on Linux and I believe it's better to let the system handle this. I don't think a ~1GB cache is too much, compared to the performance benefits of caching.
Nowadays I run a script every few weeks that deletes older entries which usually brings it back down to ~150mb on my system.
Remember that this is indexed data - if you mess around with just deleting some files you might have issues with "hickups"/possibly breaking sites when the browser tries to get files from disk cache that no longer exist. Not saying it's guaranteed, but it's a possibility to be aware of when messing with this.
IMO it would be better to just clear out the whole cache dir, as it would also delete the indexes, letting the system start fresh.
-
@Pathduck I tried suggested values and made up values for cache size and a value that used to work. I've not said anything because I couldn't find anyone else complaining about it...
I've been deleting cache items like this for years now without noticing any problems from it
-
@lfisk Right now at ~293mb there are 12550 files in cache. My harddrive isn't exactly fast and I think the problem is it takes longer to look in cache than to just get it fresh from the internet
-
This is mainly for backing up. Backing up an extra gig of cache, and deleting the gig of old cache from the existing backup takes ages due to the small size of the many files. So really it's just a time saver, and writing less to the disk therefore extending it's life.
-
@boristhemoggy Even a better argument for excluding the cache directories from backup instead of messing around trying to purge cache before a backup.
I use Areca backup, it's old and Java-based (ugh...) but works fine for my purposes. One thing I like is that backups are versioned and compressed zip files, and that I can recover individual files/dirs easily.
<directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/Cache"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/Code Cache"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/File System"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/GPUCache"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/IndexedDB"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/Media Cache"/> <directory_filter logical_not="true" directory="C:/Users/Stian/AppData/Local/Vivaldi/User Data/Default/Service Worker"/>
(yes there's a UI for this)
https://en.wikipedia.org/wiki/Areca_Backup
https://sourceforge.net/projects/areca/ -
@Pathduck I have tried Areca, not updated for about 10 years
and had to install a Java machine
However the only benefit it has over my current program is the ability to select files and folders. I use FreeFileSync and you can select files and filders to not be included, but individually and only after the comparison scan has completed.
I will stick with my .cmd file for now and continue with FreeFileSync, it's the best of a bunch tbh. -
After weeks of thinking what to do with cache folders I did things in points below:
- buy Soft Perfect Ram Disk (not expensive)
- set this application to make 25 GB ramdisk in drive Y: with folder "Vivaldis" (in startup) (I have 64 GB ram)
- write batch file to unzip 4 Vivaldis to this folder and put this batch in in startup
(I have 4 Vivaldis: GENERAL, SHOPS, APPLICATION, YOUTUBE) - So I use Vivaldis in Ramdisk
- Before shutting Windows I run the 2nd batch file which zipps my 4 Vivaldis to folder in D drive .
- After booting Windows the batch file (p.3) unzipps 4 instances of Vivaldi to ramdisk.
- Working properly.
- My Windows TEMP folder is in ramdisk too.
I know that my comment doesn't fit exactly to the theme, but it says about solving a problem with cache.
-
I forgot to add important thing:
the second batch file (p.5) zipps Vivaldi folders excluding cache folders. -
@notatka OK so spending a lot of RAM to run browser installs. It's fast(er) I guess - once it's up and running, but I couldn't stand the wait to unzip 4 huge archives to RAM and then have to remember (and wait again!) for it to cleanly pack them back again...
To what purpose exactly? Save disk writes, performance? Peace of mind?
Have you looked into the Chromium command arguments, specifcally:
--profile-directory Selects directory of profile to associate with the first browser launched. --user-data-dir Directory where the browser stores the user profile. Note that if this switch is added, the session will no longer be Incognito, unless Incognito mode is forced with --incognito switch.
https://peter.sh/experiments/chromium-command-line-switches/
Given that just the binaries for a Vivaldi Standalone install is 750+MB you could save a lot of time (and precious RAM!) by either:
- Launching different profiles under the same User Data dir
- Or using different User Data dirs all with just the Default profile
Note also that the cache is by far the largest part of the browser profile, containing thousands of small files, which take for ever to de/compress every time. By simply deleting the cache folders before compressing the profile(s) you could save a lot of IO operations and time.
But hey, you do you right?
-
@Pathduck
Unzipping 4 instances of Vivaldi to ramdisk lasts 2 minutes (starting Windows).
Zipping - 6 minutes (shutting Windows).
I do it once in the morning (unzipping) and once in the evening (zipping), because my computer works all the day.Cache files exist only in ramdisk in my Vivaldis.
I don't have cache folders in compressed files. Yes they are deleted from ramdisk before compressing to drive D.
I feel better with 4 instances instead of 4 profiles.
You know, everyone has his own habits. -
@notatka My argument was basically there is no need to install (and update) four different installs - you can use the same Vivaldi binaries for four different profiles (or user data dirs).