tmpfs for ~/.cache?



  • just a quick question - is setting up a tmpfs possible under ut?



  • @utouchuser There are different layers to that question. tmpfs is available as a file system. On the other hand, there is currently no mechanism for defining custom mount points ...



  • ok, i see. so it is not impossible and could be a feature for future versions, after all?

    what options is there avaiable right now to quickly clear the cache?



  • I don't know about tmpfs but I do know you can edit /etc/fstab and define custom mount points, however fstab is overwritten at boot with the default file so changes are only temporary.



  • You definitely do not want to set up the ~/.cache/ directory as a tmpfs mount. You are only asking for problems if you do that, especially if you use dekko or libertine.



  • hi dobey,

    can you be a bit more specific about these possible problems arising?

    with tmpfs, you would start with a clean cache everytime the phone gets initially booted - but this does not mean it can't be repopulated anymore.



  • @utouchuser
    With dekko and libertine there is more than just 'cache' information in the .cache directory.
    So erasing it at each reboot will destroy your email configuration...



  • @AppLee

    ok, thanks for pointing out.

    i was not aware of this situation, i believed that sensible data is stored elswhere (~/.config?) in order to prevent a scenario like this.

    under linux, this is actually my setup for years without problems so far.



  • @AppLee Exactly! And precisely, concerning dekko2 at the moment, it can be useful to keep a backup of the dekko2.dekkoproject directories in .cache, .config, .local/share so that we can restore them if necessary... It was useful to me 😉



  • @utouchuser Well, tmpfs is just a RAM disk. So anything you put in a tmpfs mount, will take up space in RAM. You will be rebooting quite often if you make ~/.cache/ a tmpfs mount, and actually use the phone at all, especially if you want to download anything, for example.



  • @dobey said in tmpfs for ~/.cache?:

    Well, tmpfs is just a RAM disk. So anything you put in a tmpfs mount, will take up space in RAM

    true, but it should also be mentioned that space is allocated dynamically, no data = zero disk space. the whole idea behind a tmpfs for /.cache is a further bit of privacy (perhaps security too?), starting off with a clean cache on every reboot.

    another benefit could be an increase of speed, ram is faster than any traditional data carrier. after all, this is about mobile phones and not classic desktop enviroments, so it also depends on the device ut is running on, no doubt.



  • @utouchuser said in tmpfs for ~/.cache?:

    true, but it should also be mentioned that space is allocated dynamically, no data = zero disk space. the whole idea behind a tmpfs for /.cache is a further bit of privacy (perhaps security too?), starting off with a clean cache on every reboot.

    There will never be no data, as Qt writes cache for QML compilation and other things to it. I also don't think it will really increase privacy or security. Confined apps already can't read data from other apps, only their own cache, so this won't change anything in that respect. It sounds like a workaround for other problems in that case.

    @utouchuser said in tmpfs for ~/.cache?:

    another benefit could be an increase of speed, ram is faster than any traditional data carrier. after all, this is about mobile phones and not classic desktop enviroments, so it also depends on the device ut is running on, no doubt.

    Rather you will actually end up with the opposite, as RAM will fill quickly with QML and image caches from apps, and because these caches will need to be rebuilt all the time, apps will be slower to start and use. And indeed we're talking about mobile devices, so you don't have 64G of RAM, but more often 1-2, or a 3-4 on most newer devices. Some higher end devices might have more available, but still nowhere enough to make this a useful thing to do. Also, as mobile devices are already using solid state storage, read/write speeds aren't a huge hindrance, unless you're using a bad app which is constantly hitting disk, which shouldn't be done (every write to disk reduces the lifespan of the storage).



  • @dobey: you are much more into this matter than me and the points you mention seem valid. in the end, this was just a vague idea that came to my mind while thinking of improving privacy and performance a bit further.

    i hope further weird ideas are still welcome in this forum 😉


Log in to reply