Sharepoint iframe caching

Patrick Poynter 25 Reputation points
2024-12-14T10:24:30.8933333+00:00

I have a sharepoint iframe which embeds an azure app service, which has authentication enabled. When the iframe loads it implicitly uses the sharepoint details of the authenticated user all good.

The problems come when the iframe is cached, because a sharepoint session lasts longer than that of the app service, it results in the app not working properly as it uses the cached version and isn’t actually authenticated.

Is there any ways in which I can prevent this from happening and use the full implicit authentication flow each time the sharepoint page in which has the iframe is loaded?

I have tried putting

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="0"> in the headers of my index.html, as well as adding the environment variables for no caching to my app service but unfortunately this still gives me 304 or 200 (disk cache) codes, I am wondering if it could be something with the IIS config?

Any help would be greatly appreciated.

Microsoft 365 and Office SharePoint Development
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.