Cache Clearer

← All AI-created software

This is AI-generated (aka vibe-coded) software. It is specific to my needs and my system and may not work for you or yours. Support is limited, but if you report a bug I'll certainly look into it. The code is provided in the zip file for you to review should you choose.
⬇️ Download Cache Clearer.zip137.3 KBLast Updated: November 27, 2026Vivaldi

Clears Vivaldi’s cache (cached images and files) automatically: every few minutes, hours or days, at set times on chosen weekdays, on set dates, whenever the browser starts or a profile is opened, or on demand.
It can also clear sites’ offline caches, skip sites you choose, and back its settings up to a folder every few days.

Everything runs locally. The extension makes no network requests, reads no page content and has no host permissions. It never touches history, cookies, passwords or site logins.

The options page: a set time of 9:00 every day, a passed one-off date, the next set time, and the backup section
On this page

Install

  1. Open vivaldi://extensions and turn on Developer mode.
  2. Click Load unpacked and pick this folder.

The options page opens after installing. Click the toolbar button to open it again.

Using it

When to clear

Tick any mix of triggers. Changes are saved as you make them:

  • On a schedule, every N minutes / hours / days (1 to 999 of the chosen unit). The next clear is timed from the last one, so restarting the browser or changing other settings doesn’t push it back.
    If the browser was closed or asleep when a clear fell due, it happens shortly after it’s running again.
  • At set times, on the chosen days. Add a time adds a row with a time and the days of the week it applies to (all ticked to start with). Add as many rows as you like, e.g. 9:00 on weekdays and 13:00 on Saturdays. A row with no days ticked never runs and says so.
  • On set dates (once each). Add a date adds a date and time (tomorrow at 9:00 to start with).
    Each runs once; afterwards the row shows Passed until you remove it.
  • Below the two lists, Next set time shows when the next set time or date will clear. Times are in your computer’s local time. If the browser was closed when a set time or date went by, the cache is cleared once when the profile next opens (once, however many were missed), then the next one is planned. With the startup trigger also on, that startup clear counts for it.
  • When the browser starts or this profile is opened.
    This is chrome.runtime.onStartup, which fires once per profile when that profile first opens: at browser start for the profile that opens then, and later for any other profile the moment you open a window for it.

Clear cache now clears straight away. The Last cleared line shows when the last clear happened and what triggered it, or the error if it failed.

Profiles and limits

  • Each Vivaldi profile is separate. A profile runs its own copy of the extension with its own settings, and can only clear its own cache. Install the extension in every profile you want cleared (or restore a backup file into each one).
  • Opening a second window of a profile that is already open doesn’t count as opening the profile, so it doesn’t clear.
  • Private windows aren’t cleared. Their cache is kept in memory and thrown away when they close.
  • There is no “on exit” trigger. Extensions get no reliable event when the browser closes. Use the startup trigger instead, which clears what the last session left behind.
  • Vivaldi’s own data (thumbnails, speed dial images, the session) is not part of the browser cache and isn’t touched.

What to clear

  • Cached images and files (the HTTP cache) are always cleared, from all time.
  • Also sites’ offline caches adds Cache Storage, which sites and web apps use to work offline. Clearing it can make such apps download everything again, or stop working offline until you visit them online.
  • Never clear these sites takes one site per line: example.com means https://example.com; write http:// or a port to name a different origin. Each line is an exact origin, so example.com doesn’t cover www.example.com. Anything that isn’t an http(s) site is dropped when you leave the box.

Keeping the current site from the toolbar

Right-click the toolbar button and choose Never clear this site (or clear it again). It adds the current tab’s site (its exact origin, e.g. https://www.example.com) to “Never clear these sites”, or takes it off if it’s already there. The button briefly shows + (added) or − (removed), and hovering it says which site. On a page that isn’t an http(s) site, such as vivaldi:// pages, it shows ! and changes nothing.

Backup and restore

Settings can be exported to a JSON file and imported again from the options page. Scheduled backups are saved into a folder inside Downloads every N days. Only the newest backup from each earlier day is kept, for as many days as the “Keep” setting allows. A restored file is checked the same way as the settings form, so a crafted file can’t store anything the form wouldn’t. The last-cleared time isn’t part of a backup.

Files

File Purpose
manifest.json Manifest V3, module service worker
background.js Service worker: the clear alarm, the startup trigger, clearing, the toolbar menu, message handlers and scheduled backups
lib.js Settings, sanitizeSettings, toggleKeepSite, alarm timing (alarmPlan, firstDelay), the browsingData arguments (removalArgs), backup file build and parse (tested in Node)
options.html, options.js, options.css Options page
shared/backup.js Shared backup helpers and scheduler, on globalThis.SharedBackup. A plain script, so the worker loads it with import and pages with <script>. Do not edit here
shared/sender.js Shared message-sender and host checks. Do not edit here
shared/suite.js Link to the Plugin Suite Backup Manager, on globalThis.SuiteLink. Do not edit here
shared/brand.js The “Made by infolific.com” footer on this plugin’s pages (logo, plugin page and hub links). Do not edit here
shared/infolific.png, shared/infolific-24.png The infolific.com logo, for the footer and (24px) the top of this README
test_backup.mjs Node tests for lib.js and shared/: node test_backup.mjs
test_worker.mjs Node tests that run background.js against a fake chrome: node test_worker.mjs
screenshot.png The options page, for this README

Permissions

Permission Why
activeTab Reading the current tab’s address, only when you choose the toolbar menu item
contextMenus The “Never clear this site” item on the toolbar button’s right-click menu
browsingData Clearing the cache (and, if chosen, Cache Storage)
alarms The clear schedule, and the hourly check for whether a scheduled backup is due
storage Settings and the last-cleared time
downloads Saving scheduled backups and removing old ones

Implementation notes

  • Clearing is one call: chrome.browsingData.remove({ since: 0, excludeOrigins }, { cache: true, cacheStorage }).
    removalArgs in lib.js builds both arguments from the settings.
  • The schedule is one repeating alarm, clear-cache.
    Chrome doesn’t promise that alarms survive a restart, so syncAlarm runs on install, on every startup and whenever the settings change. alarmPlan keeps an alarm whose period already matches, removes it when the schedule is off, and otherwise creates it with the first delay counted from the last successful clear (firstDelay).
  • Set times and dates share one one-shot alarm, clear-at, set for the soonest upcoming one (nextTimedClear in lib.js, which works in local time so daylight-saving changes are handled). Its time is also kept in storage (nextTimedClear), so planTimed can tell at startup that a planned time went by while the browser was closed, clear once, and plan the next. planTimed calls run one after another, and the next time is counted from the one just handled, so an alarm that fires a few seconds early can’t clear twice.
  • A startup clear and an overdue alarm often arrive together; clearCache runs one clear at a time and hands both callers the same result.
  • onStartup can’t be tried out with Playwright: an extension loaded with --load-extension is installed afresh on every launch and gets onInstalled instead. Load it with Load unpacked and restart Vivaldi (or open a second profile) to try the startup trigger.

Security notes

  • Every message handler checks the sender with shared/sender.js. clear-now and backup-now are accepted only from the options page.
  • Settings from storage, the form or a backup file all go through sanitizeSettings. Kept sites are parsed with URL and stored as bare http(s) origins.
  • There are no content scripts and no host permissions. The toolbar menu sees the current tab’s address only through activeTab, which Chrome grants for that one click. Text is written with textContent, never innerHTML.
  • The link to the Plugin Suite Backup Manager (shared/suite.js) answers only the manager’s fixed extension id. It can report the backup schedule and last backup, start a backup, and open the restore page with a backup file. It never writes settings itself, so a file it hands over goes through the same checks and confirmation as one picked on that page.

Tests

node test_backup.mjs && node test_worker.mjs

Version history

1.0.0 — First version: clears the cache on a schedule (minutes, hours or days), at browser or profile start and on demand, with optional Cache Storage, kept sites, and settings backups.

1.1.0 — The toolbar button’s right-click menu adds the current site to “Never clear these sites”, or takes it off again.
New broom icon.

1.2.0 — No Save button: the options page saves each change as you make it.

1.3.0 — Clears at set times on chosen weekdays and on one-off dates, catching up once at startup for any that went by while the browser was closed.

1.4.0 — Works with the new Plugin Suite Backup Manager, which shows this plugin’s backup schedule and last backup, can start a backup, and can hand a backup file to the restore page here.
Only the manager’s extension id is answered (shared/suite.js).

1.5.0 — infolific.com branding: a “Made by infolific.com” footer on the options page, linking to this plugin’s page and the infolific.com hub for AI-created software (shared/brand.js); a small infolific.com badge on the icons; and the manifest’s homepage_url points to the plugin’s page, so the extensions page shows a Website link.

⬇️ Download Cache Clearer.zip137.3 KBLast Updated: November 27, 2026Vivaldi

← All AI-created software