luakit / luakit

Fast, small, webkit based browser framework extensible by Lua.
https://luakit.github.io/
GNU General Public License v3.0
2.08k stars 250 forks source link

FR: disk cleanup routine #796

Open bodqhrohro opened 5 years ago

bodqhrohro commented 5 years ago

I'm submitting a…

Feature Request

Current Behavior

No cleanup routine.

Expected Behavior

The ~/.local/share/luakit/local_storage directory gets messed up with temporary SHM/WAL files of sqlite (probably when WebKitWebProcess crashes). These files reside here until (and if) the following site is visited next time. While the databases themselves are often tiny, WAL files are about 200 KB, and in total they can waste tens or even hundreds of megabytes of disk space. Though, simply opening these databases, making a simple query and correctly closing them removes the excessive SHM/WAL files:

ls ~/.local/share/luakit/local_storage/*shm|sed 's/-shm//'|while read a; do sqlite3 -batch "$a" 'select * from ItemTable;'; done

It would be great to have a routine in LuaKit itself, that does a similar thing when manually executed, and possibly other things that cleanup/fix the browser data. Also, LuaKit seems to miss a setting for the cache size.

Reproduction Instructions

Environment

Linux Distribution & Version: Debian 11 Output of luakit --version: luakit 2.0.0 built with webkit 2.22.6 (installed version: 2.24.3)

taobert commented 3 years ago

If this gets implemented as a general disk cleanup routine, #494 may be relevant. Edit: Likewise, if #589 gets implemented, then any disk cleanup routine may need to avoid cleaning up bookmarked sites.