You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The cache key can be used to identify the cache. It shall be based on the project's name and version as well as a SHA256 hash of the versions of the relevant UI5 Tooling modules (`@ui5/project`, `@ui5/builder`
116
-
`@ui5/fs`), the names and versions of the project's dependencies and the current build configuration (ui5.yaml + CLI parameters). This shall allow the UI5 Tooling to determine whether the cache is still valid or not.
115
+
The cache key can be used to identify the cache for a project. It shall be based on the project's name and package version, as well as a SHA256 hash compiled from the following information:
116
+
117
+
* The versions of all UI5 CLI packages used to create the cache: `@ui5/project`, `@ui5/builder` and `@ui5/fs`
118
+
* Different UI5 CLI versions must produce a new cache. Alternatively, we could introduce a dedicated "cache version" that is incremented whenever a breaking change to the cache format is introduced. This would allow reusing the cache across minor UI5 CLI updates.
119
+
* The relevant build configuration (ui5.yaml + CLI parameters).
120
+
* Changes in the build configuration must result in dedicated cache.
121
+
* Some configuration options might not be relevant for the build process (e.g. server configuration). Those could be excluded from the hash calculation to improve cache reusability.
122
+
*_**To be decided:** the names and versions of all UI5 project in the dependency tree_
123
+
* Changes in dependencies might affect the build result of the current project. However, relying on resource-level cache invalidation might be sufficient to detect such changes.
117
124
118
125
**taskCache**
119
126
@@ -142,7 +149,9 @@ The directory structure is flat and efficient. A global `cas/` directory stores
142
149
└── cache-info.json
143
150
```
144
151
145
-
All unique file contents from all projects and their builds are stored **once** in the global `cas` directory, named by their content hash. This automatic deduplication leads to significant disk space savings.
152
+
Besides the `cas` directory, each project has its own directory named after its cache key. This directory contains only the `cache-info.json` file for that project.
153
+
154
+
All unique file contents from all projects and their builds are stored **once** in the global `cas` directory, named by their content hash.
146
155
147
156

148
157
@@ -174,6 +183,10 @@ A mechanism to purge unused cache on disk is required. The cache can grow very l
174
183
175
184
This should probably use some sort of LRU-cache to purge unused cache entries dynamically. The same mechanism could be applied to the npm artifacts downloaded by UI5 Tooling.
176
185
186
+
To avoid slowing down core commands, the purge check should run as a non-blocking process after a successful ui5 build or ui5 serve command completes. This process checks if either of the configured thresholds (age or size) has been exceeded. If so, it proceeds with the purge.
187
+
188
+
A dedicated command, such as `ui5 cache clean`, should be introduced in addition. This command allows users to manually trigger a cache purge, providing options to specify criteria such as maximum age or size for cache entries to be removed. Similarly, a command `ui5 cache verify` could be provided to check the integrity of the cache.
189
+
177
190
### Watch Mode
178
191
179
192
The build API should provide a "watch" mode that will re-trigger the build when a source file is modified. The watch mode shall select the projects to watch based on which projects have been requested to be built. If a [UI5 Tooling workspace](https://sap.github.io/ui5-tooling/stable/pages/Workspace/) is used, this can be fine-tuned in the workspace configuration.
0 commit comments