Forcing a page to reload

We have several PDFs (actually generated on the fly).
The user may pick one, press a button, and the PDF is shown on the screen. The user may then download it or email it. This works.

The problem is that if after viewing one of the, the user selects a different one to view and presses the button. The first PDF is shown. It appears the browser is caching as the code that does all the work is not called again.

Is there a way around this?

Depending on your code, you might be able just append something like ?v=DateTime.SecondsFrom1970 here. So that filename in the URL might look like:

Bear in mind that this is untested with Xojo, but is common on the web for getting around browser caching.

1 Like

There should be a WebFile.Cached boolean property letting you know if it is cached. Docs say it’s not writable. Maybe it would be good to have the option to set the cache control header?
May be worth a feature request.