-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Browser Caching Swagger Page "Get" Requests at Standard Text Endpoint #836
Comments
CDA sets the header for In Swagger if you want to do your testing there you can (on your end) click the box to "disable cache" in the dev tools. As for client applications that are either native, web based, or otherwise. You could manually decide if you want to cache or re-request. As just an example for web that would look like this (For VanillaJS) fetch("cda/ts/url", { cache: "no-store" }).then((response) => {
/* consume the response */
}); Via But good point this is something to be aware of, and i'm not sure this is listed anywhere so thought i'd mention the above! |
It's odd that CLOB end point doesn't seem to have this issue. |
Good chance the clob doesn't have the cache headers set I just assumed all were by default set to 5 @MikeNeilson any ideas on which endpoints might have this? |
Should be most of them. Which 99% of the time is the right thing to to do. This is clearly in that 1%. That said I think the full and proper solution is going to use etags and the database informing the API there's a new version. |
A simple solution can just be to add a random, but unused parameter to the parameters, but that only works outside of swagger. |
@msweier How are you using the Clob endpoint? Are you requesting as text/plain? The Clob controller should have the same caching headers set but text/plain is being handled in a special way for clob so that large clob (gigabytes?) can be streamed directly from database and the clob end-point also supports range-requests. It wouldn't surprise me if browser or libraries are making requests against clob in ways that aren't going to benefit from normal cache-control headers. |
I was just using the CLOB endpoint to view the standard text w/ the Swagger docs. Just testing. |
@tsressin you might be interested in this thread |
I noticed Chrome was caching my Swagger page "Get" request when I was playing around GET/POST/DELETE with the Standard Text end point. After a POST or DELETE the GET request on the Swagger page wouldn't reflect the change. Not sure if anything can be done, but something to be aware of.
The text was updated successfully, but these errors were encountered: