|
Rank: Newbie Groups: Member
Joined: 6/14/2016 Posts: 6
|
I have a question about caching; i have an url and i can open it in different tab pages on the same window application program. In every different tab pages there is an EO.WebBrowser and they open the same url on different webviews. I want to learn about caching at this situation. Every webview objects have their own caching mechanism or only one caching ? When i open the second tab and follow the client logs from dev tools with remote debug, i see always 200 so i think that caching doesnt work for the second webview. Is it true and is there any way to use caching data for second tab ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, The caching works on the engine level. See here for more details: https://www.essentialobjects.com/doc/webbrowser/advanced/engine.aspxSo if both WebView uses the same engine (this is the case by default because by default all WebView uses the "Default" engine), they should use the same cache. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 6/14/2016 Posts: 6
|
thanks for quick reply,
I want to ask one more question about caching;
On our web project we use nginx cache configuration and when we open the project on chrome and watch network from devtools we see 304 status but when we open on windows application with eo browser and watch from devtools with remote debug, we see always 200 status but on size column it writes (from cache). Does eo browser engine use its own cache mechanism or our nginx cache settings still works ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, EO.WebBrowser will use its cached version if it is still valid (not expired), that's what cached is for and how it supposes to work. There are two ways to invalid cache, you can either delete the cache folder all together, or call WebView.Reload after you load the page. You can delete the cache folder in your code with this call: https://www.essentialobjects.com/doc/eo.webengine.engine.cleanupcachefolders_overloads.aspxThanks!
|
|
Rank: Newbie Groups: Member
Joined: 6/14/2016 Posts: 6
|
Hi,
On WebView.Reload method it loads the page from the begining and it is useless for us. I tyried the CleanUpCacheFolders method but this time it does not load any js files and writes "failed" on status column and on size column writes "from cache". it still tries to read from cache. Is there any property or something else i have to set ?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
CleanUpCacheFolders should only be called when the "Engine" is stopped, which usually means your application is stopped. So if you call CleanUpCacheFolder and then restart your application (or call CleanUpCacheFolder every time your application start), then it will work.
There are a whole set of standards that defines the behavior of browser caching, both EO.WebBrowser and all other browsers will have to follow these standards. So if you are expecting to do something different than the standard way with EO.WebBrowser, then you will not be able to do it. In your case, the best way to do it is to use a method that the standard explicitly defines not cachable. For example, the standard says HTTP POST is not cachable, so if you use HTTP POST for each page, then the page result will not be cached (all dependencies such as JS files will still be cached, I believe that's what you wanted).
Hope this helps.
Thanks!
|
|