To turn off caching in Swagger UI, you need to update the Swagger UI configuration options.
index.html
or index.js
.config
variable, which contains the Swagger UI configuration options.cache
option to the configuration object and set it to false
. For example:const ui = SwaggerUIBundle({
url: "https://petstore.swagger.io/v2/swagger.json",
dom_id: "#swagger-ui",
deepLinking: true,
cache: false
});
Note that disabling caching can impact performance, as resources may need to be fetched from the server every time the Swagger UI page is loaded or refreshed.
Asked: 2021-05-15 11:00:00 +0000
Seen: 10 times
Last updated: Apr 28 '22