Welcome Guest Search | Active Topics | Sign In | Register

Read website offline after the first online Options
Khoa
Posted: Thursday, April 30, 2020 4:38:05 PM
Rank: Advanced Member
Groups: Member

Joined: 9/3/2014
Posts: 68
Hi,

I am looking for the solution to store web resources (*.html, *.js, *.css) in memory so EO.WebBrowser will fetch them only one time to store in the memory with byte[] arrays. As the website does not often change, so next time the browser will read web resources offline after downloading them in the first time.

Thank you.
eo_support
Posted: Thursday, April 30, 2020 7:42:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Hi,

There are no built-in support on the browser engine for this. You have two options:

1. Implement a web server and serve those contents to EO.WebBrowser. You can then handle all the caching in your own web server; -- OR --
2. Implement your own custom resource handler and then serves the resources through your handler:

https://www.essentialobjects.com/doc/webbrowser/advanced/resource_handler.aspx

The identical part for both options is you will need to write the code to serve the resources. The code itself may not be difficult though --- for example, you can simply read from a local file and pass the contents down streams. The main difference between the two solutions is when you use your own web server, the Url must be your own web server's Url, where as for the second option you can use real Urls --- you can just intercept those Urls in your custom resource handler so that the request never reaches the real web server.

Hope this helps.

Thanks!
Khoa
Posted: Friday, May 1, 2020 4:40:35 PM
Rank: Advanced Member
Groups: Member

Joined: 9/3/2014
Posts: 68
Thank you very much. It does really help me a lot. I am going with option 2.
eo_support
Posted: Friday, May 1, 2020 5:04:24 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.