plateaukao / einkbro

A small, fast web browser based on Android WebView. It's tailored for E-Ink devices but also works great on normal android devices.
Other
1.05k stars 77 forks source link

Unnecessary page reloads/no cache #360

Open AJolly opened 3 months ago

AJolly commented 3 months ago

This browser does not properly cache in memory or on disk the current page.

This manifests by it attempting to reload the page, and is noticeable by 1) losing your position on the page, as well as 2) attempting to load it again from the network which fails if you no longer have a network connection.

I especially noticed this if I'll leave my ebook reader alone for a little while, especially if I'm reading a large text heavy page such as a chapter from The wandering inn.

This is even true if I haven't switched away from einkbro.

I can understand this behavior more on mainstream browsers, but less on a browser that's targeted at eink and reading.

plateaukao commented 3 months ago

what device are you using?

And, I think it's common to ask users reload the page if the network was gone, and back to normal.

If you really want to read a text heavy page, suggest saving it to epub in einkbro, and read it by reader apps you like.

AJolly commented 3 months ago

Boox Page. Forced reload seems like it causes more problems, it makes sense on a phone, but I don't have an always on internet connection on my ereader. (So it's fine at home, but I'll grab it and want to keep reading in an uber, have to bridge to my phone, or remember to presave before hand.

plateaukao commented 3 months ago

there's no specific cache mechanism in EinkBro. If you don't close the app , and system is not killing EinkBro, the loading content would be there. If you leave EinkBro app with a large website opened, system may close EinkBro when it's no longer on the foreground. After that, all web pages should be reloaded. That's how browser works. If you don't always have internet, as I suggested, please save the web content as epub file (it's available in menu), and read it in reader app inatead.

uqs commented 3 months ago

My workaround for that is to save long reads to epubs always. I also noticed that einkbro does not restore the scrolling position when it gets killed by the OS. Other browsers handle this better (but still not great).

Vivaldi is an Android browser that also handles the offline case (but has imperfect handling of scrolling positions ...), and will tell you that you're looking at an offline version of the (cached) page.

einkbro's epub support however is also not ideal, as it will reload the page into reader mode before saving, instead of "simply" passing the current DOM over to reader mode, so it fails to handle dynamically loading pages properly.

plateaukao commented 3 months ago

@uqs you could use save archive(next to open eixsting epub button) it will save web article in original layout as a mht file. afterward, you can open it again with einkbro.

AJolly commented 3 months ago

I've had it killed even when I have not switched away from einkbro. At the least, storing the position on the page would be nice

plateaukao commented 3 months ago

strange. usually it won't kill app in the foreground. that's not a common behavior on browser to restore loaded content, and its last position. maybe you can find other browsers that support this.

AJolly commented 3 months ago

Chrome will happily remember my position even if I haven't touched that tab in weeks, and have opened hundreds of other tabs in the meantime.

I right now resumed reading a chapter on my phone, that's what made me remember to check in on the github issue.

If it helps I also suspect eink bro is unnecessarily refreshing background tabs, (judging by the page titles changing)