Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable caching in Swagger UI

I am using swagger UI for documenting the APIs. I have deployed the Ui and node server( that has JSON) using docker. After deployment, when I make changes in JSON file, the same is not getting reflected in swagger-UI unless i refresh the whole page.

I tried to add <html manifest="example.appcache">in swagger-ui's index.html and the manifest file has the following config

CACHE MANIFEST
NETWORK:
*

Even after setting the manifest the JSON still gets loaded from cache. Can someone help please.

like image 340
Poppy Avatar asked Dec 05 '25 03:12

Poppy


2 Answers

If you are using version 3 (Springdoc), you can simply add the following to your application.yaml file.

springdoc:
  cache:
    disabled: true

or related property to application.properties file.

like image 95
gsan Avatar answered Dec 09 '25 01:12

gsan


You can simply disable caching in your browser dev tools (network tab).

like image 33
bastianowicz Avatar answered Dec 09 '25 00:12

bastianowicz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!