Reload webview URL when revisiting page?

Hello,

Is it possible to reload the original webview URL when revisiting that page within the app, rather than it picking back up where you left off?

It depends on what you’re trying to do, I guess. There is no simple way to disable caching, or force a reload of a URL, because I imagine that would break a very simple use case when you simply want to go back/forward in browsing history.

If you are re-opening a WebView from a button click, you can add a random GET parameter to the URL to force cache override.

Hope this helps.

Thanks for replying! Yes, I’d need it when re-opening from a button click. Do you have any examples of setting up a GET parameter? I’ve been searching the docs but haven’t found it. Sorry for the runaround, I’m new to all of this :slight_smile:

The GET params I was referring to are in no way related to Fuse. It’s just an HTTP thing.

Luckily, it appears that we can avoid hacking manual cache overrides in this case, by making the WebView go to the original Url every time a given page is Activated. Complete, minimal, working repro:

<App>
	<Router ux:Name="router" />
	<JavaScript>
		function openTwo() {
			router.push("two", {});
		}
		function goBack() {
			router.goBack();
		}
		module.exports = {
			openTwo: openTwo,
			goBack: goBack
		};
	</JavaScript>
	<ClientPanel>
		<Navigator DefaultPath="one">
			<Panel ux:Template="one" Color="#18fa">
				<Clicked>
					<Callback Handler="{openTwo}" />
				</Clicked>
			</Panel>
			<DockPanel ux:Template="two" Color="#1f8a">
				<JavaScript>
					function resetUrl() {
						wv.goto("https://www.fusetools.com/");
					}
					module.exports = {
						resetUrl: resetUrl
					};
				</JavaScript>
				<Activated When="Immediate">
					<Callback Handler="{resetUrl}" />
				</Activated>
				<Panel Height="56" Dock="Top" HitTestMode="LocalBounds">
					<Clicked>
						<Callback Handler="{goBack}" />
					</Clicked>
					<Text Value="Go Back" Alignment="Center" />
				</Panel>
				<NativeViewHost>
					<WebView ux:Name="wv" Color="#fff" Url="https://www.fusetools.com/" />
				</NativeViewHost>
			</DockPanel>
		</Navigator>
	</ClientPanel>
</App>