Ask Your Question
4

What is the process to turn off caching in Swagger UI?

asked 2021-05-15 11:00:00 +0000

lakamha gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-04-28 15:00:00 +0000

devzero gravatar image

To turn off caching in Swagger UI, you need to update the Swagger UI configuration options.

  1. Open the Swagger UI configuration file, usually index.html or index.js.
  2. Locate the config variable, which contains the Swagger UI configuration options.
  3. Add the 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
});
  1. Save the configuration file and reload the Swagger UI page.

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-05-15 11:00:00 +0000

Seen: 10 times

Last updated: Apr 28 '22