Replies: 4 comments 2 replies
-
@yildirimcagri-msft do you have any insights into this? |
Beta Was this translation helpful? Give feedback.
-
Hello, would somebody please look at my question. |
Beta Was this translation helpful? Give feedback.
-
@NaderNashed , are you modifying the request via WebResourceRequested? You should not need to set a 304 (not modified) response unless it is a conditional GET request. The request must be normally expected to be served from cache (for example cannot be a POST request) even with the Cache-Control header. Also, have you tried unsubscribing from the WebResourceRequested event after setting the response with Cache Control header? |
Beta Was this translation helpful? Give feedback.
-
I don't modify the request and all are GET, no POST (static scripts/.css/images). I didn't try to unsubscribe. but if I do, how that would work if the cache got cleared for any reason. I mean, in a normal web application, the browser will serve from the cache and if for any reason it is not available it will send it to the backend. In the webview case, how can I tell whether the cache is available and whether I should be subscribing. (FYI, all the resources are embedded resources in a .dll) |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm using WebView2 version 124.0.2478.109. My WebView2 is registered to a custom requestType (named "ProvideFile") and Source property is set to an external app's Uri. When the WebResourceRequested event fires up, the external App is able to get all the Bundle Files by which WebView2 can run the correctly the hosted web app. All works fine, no problem.
By design I know that all the files provided by the external app are always the same. So I'd like to avoid to claim those files each time. In other word I'd like to get them from the browser cache starting from the second time I claim them.
How can I force cache usage when all the application's bundle file are provided by WebResourceRequested mechanism?
I'll appreciate any help you can provide,
Beta Was this translation helpful? Give feedback.
All reactions