Skip to content

[🚀 Feature]: Automatically prune Selenium Manager cache #17196

@dmke

Description

@dmke

Description

The Selenium cache (~/.cache/selenium) grows without bounds: I just have found and deleted 19 GB of old chrome and chromedriver versions :)

I would like to impose a limit here, and automatically prune this directory by deleting everything but the last N versions.

This limit could be opt-in, and should be evaluated/imposed whenever a new version is downloaded.

Have you considered any alternatives or workarounds?

  • selenium-manager --clear-cache (and --clear-metadata) exists, but that's a nuclear option similar to rm -rf ~/.cache/selenium. I do usually need the latest chrome/chromedriver version, so removing the cache directory on a regular basis means (unnecessarily re-) downloading those programs.
  • manually running a find | sort | tail -n+10 | xargs rm -rf command is tedious, error prone (at least due to version number sorting) and dangerous (I'm never comfortable with piping into rm -rf).

I'm primarily using Selenium Manager through the selenium-webdriver Rubygem. Accessing the selenium-manager binary is a bit complicated, because the binary lives somewhere in $GEM_HOME/gems/selenium-webriver-$version/bin/linux/

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!B-managerSelenium ManagerI-enhancementSomething could be better

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions