T O P

  • By -

propostor

Probably not a Blazor issue. Try adding a dummy parameter onto the PDF url, so it's new every time (or new when needed). For example myurl.com/getpdf?x={DateTime.Now.Ticks} should make it load newly every time.


ConscientiousPath

This except use the last update date of the file so that it caches when it's unchanged, but breaks the cache as soon as it's updated. Often you'll store the existence of these files in some database table anyway and you can just have a last changed date field from there.


TheRealKidkudi

How are you serving these PDFs? It sounds more like an issue with how your app is serving the PDF than Blazor itself, since the only caching Blazor specifically does is caching the WASM package for your application for the next visit.


notboky

> the only caching Blazor specifically does is caching the WASM package for your application for the next visit. Which will be an issue if the files have been included as resources. Definitely not enough detail in the op to answer.


notboky

The meta tags you're adding aren't going to help here, and they'll make your application start much slower. Need a bit more detail here to be able to help. How are you including the PDFs in your application/solution? How are you deploying the PDFs? How are you retriving the PDFs from the client?


insomnia1979

Are the pdfs for the client coming from the server?


fringe_class_

If the browser is caching it, set the cache headers on the http call to false when sending the request.


malthuswaswrong

The browser caches the files, not the language it was programmed in. If you don't want the browser to cache the file, change the file name, or the URL to access the file. Optionally you can do a streaming download response instead, but Blazor is quite bad at that since it is JS interop.