# ui5-task-cachebuster

> Task for the UI5 CLI for simple cachebusting for standalone applications.

Latest version **3.4.0** (published 2026-05-21) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install ui5-task-cachebuster
pnpm add ui5-task-cachebuster
yarn add ui5-task-cachebuster
bun add ui5-task-cachebuster
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 3.4.0 |
| Published | 2026-05-21 |
| First published | 2022-12-01 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 34.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 220 |
| Author | Hanna Olbert |
| Maintainers | ui5-community-bot |

## Links

- npm: https://www.npmjs.com/package/ui5-task-cachebuster
- Repository: https://github.com/ui5-community/ui5-ecosystem-showcase
- Homepage: https://github.com/ui5-community/ui5-ecosystem-showcase/tree/main/packages/ui5-task-cachebuster#readme
- Issues: https://github.com/ui5-community/ui5-ecosystem-showcase/issues
- npm.io page: https://npm.io/package/ui5-task-cachebuster

## Recent versions

- 3.4.0 (latest) — 2026-05-21
- 3.3.1 — 2026-01-15
- 3.3.0 — 2025-12-02
- 3.2.3 — 2025-09-17
- 3.2.2 — 2025-09-15
- 3.2.1 — 2025-07-06
- 3.2.0 — 2025-02-06
- 3.1.1 — 2024-11-01
- 3.1.0 — 2024-09-06
- 3.0.9 — 2024-07-22
- 3.0.8 — 2024-05-15
- 3.0.7 — 2024-02-18
- 3.0.6 — 2024-01-17
- 3.0.5 — 2023-12-10
- 3.0.4 — 2023-10-14
- … 18 more at https://npm.io/package/ui5-task-cachebuster/versions

## README

## This task is only relevant for standalone applications!

> :wave: This is an **open‑source, community‑driven project**, developed and actively monitored by members of the UI5 community. You are welcome to use it, report issues, contribute enhancements, and support others in the community.

Task for [ui5-builder](https://github.com/SAP/ui5-builder), enabling cachebusting for standalone applications.

## Prerequisites

- Requires at least [`@ui5/cli@3.0.0`](https://ui5.github.io/cli/v3/pages/CLI/) (to support [`specVersion: "3.0"`](https://ui5.github.io/cli/pages/Configuration/#specification-version-30))

> :warning: **UI5 CLI Compatibility**
> All releases of this UI5 CLI extension using the major version `3` require UI5 CLI V3. Any previous releases below major version `3` (if available) also support older versions of the UI5 CLI. But the usage of the latest UI5 CLI is strongly recommended!

## Install

```bash
npm install ui5-task-cachebuster --save-dev
```

## Configuration options (in `$yourapp/ui5.yaml`)

- debug: `true|false`\
Verbose logging
- moveResouces: `true|false`\
default true: moves all the files in the build to a subfolder named `/~timestamp~/`\
false: no files are moved and no subfolder created
- excludeFromMove : eg. `["index.html", "logout.html"]`\
only relevant if moveResources is `true`\
default `["index.html"]`: the files which should not be moved into the timestamp subfolder

## Usage

1. Define the dependency in `$yourapp/package.json`:

```json
"devDependencies": {
    // ...
    "ui5-task-cachebuster": "*"
    // ...
}
```

2. configure it in `$yourapp/ui5.yaml`:

What is possible:
```yaml 
builder:
  customTasks:
  - name: ui5-task-cachebuster
    afterTask: generateResourcesJson
    configuration:
      debug: true | false
      moveResources: true | false
      excludeFromMove: ["index.html", "logout.html"]
```
For app in SAP BTP in Cloud Foundry environment with managed approuter:
```yaml
builder:
  customTasks:
  - name: ui5-task-cachebuster
    afterTask: generateResourcesJson
    configuration:
      moveResources: false
```

If ui5-task-zipper is used you need to include the beforeTask config.
```yaml
  - name: ui5-task-cachebuster
    beforeTask: ui5-task-zipper    
```

## How it works
**This is only relevant for standalone applications, not apps that run in SAP Fiori Launchpad**

Why do we need this? 
"Cache busting is a way for updates to still happen when using web caching."
To make sure that the newest deployed changes of the webapp are displayed, even though web caching is used by the client browsers, a cachetoken is added to the paths which point to the static files. This cachetoken is changing for each build, therefore the browser has to reload all resources if the cachetoken has changed.

Standalone apps have to explicitly deal with cachbusting.

This task can be used to move all files except index.html to a subfolder with the current timestamp as a name. In the index.html the `data-sap-ui-resourceroots` path is updated to include the `/~timestamp~/` path like so: `{"my.app": "./~1234241421~/"}`.
This dynamic cachebusting token ensures that the static resources will have to be reloaded after a new build was deployed.

If the app is deployed on SAP BTP in the Cloud Foundry environment with the managed approuter, the configuration `moveResources: false` should be used, since the `~token~` in the path to the files will be ignored.

If you included any other .html files in your project who's path should not change, like a logout.html which is routed to in the xs-app.json, you should add it to the `excludeFromMove` configuration. This takes an array of file paths (relative to webapp folder) which should not be moved into the timestamp subfolder.

Use Cases:
- Standalone Web-Server:
  Adapt index.html + Move files into timestamp folder 
- CloudFoundry HTML5 Apps with managed approuter:
	Just adapt index.html
-	Neo HTML5 Apps:
	Adapt index.html + enable cachebuster handling in neo-app.json with ui5CacheBuster: true

## License

This work is licensed under [Apache 2.0](../../LICENSE).

Built with care (and a lot of caffeine). If this helped you build, test, or ship, the next coffee — or drink — is on you when you bump into a contributor.

---
_Source: https://npm.io/package/ui5-task-cachebuster · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
