Do more on the web, with a fast and secure browser!

Download Opera browser with:

  • built-in ad blocker
  • battery saver
  • free VPN
Download Opera

How to set a certain amount of cache so that it does not exceed the specified size?

  • It is necessary that the volume of the cache does not exceed a total of 10 megabytes.
    The key --disk-cache-size can not cope with this task.

  • Hi @temkem, first of all one should know as follows:
    1. The "--disk-cache-size and --media-cache-size are only hints to the cache, not hard limits. In particular, 0 cannot be used to disable the cache, and values under a few megabytes are basically under the minimum size of the cache, and won't prevent writing to disk although will likely cause things to be evicted right away" - the source link.
    2. "The size should be roughly limited by the argument... so setting the limit to 10 MB should not result in the cache reporting 19 MB.
    However, we intentionally don't evict entries for the first few minutes of browsing, so if you are just adding the command line, browsing and immediately going over the limit, and looking at net-internals, the limit will not be enforced quite yet.
    Wait a few minutes before the test" - the source link.

    As in conclusion from that, what the developer wrote, you can try to experiment with lower limits for both flags, and check if you can find the proper values, that will not allow to exceed the expected disk space use.

    You can also try use the following flags, to disable other cache types:
    1. --disable-gpu-program-cache,
    2. --disable-gpu-shader-disk-cache.

    Additionally, you can check, if using the --aggressive-cache-discard flag makes any different in your case.