gnosygnu / xowa

xowa offline wiki application
Other
375 stars 41 forks source link

Cache and visited links #777

Open ghost opened 4 years ago

ghost commented 4 years ago

In xowa app noticed that when I go back to previous page via back button, it reloads, which is slow, at least for wikitext files. Can you enable some memory cache, at least few MB or for few articles (pages) to speed this up? Luckily I noticed when I use Firefox, even tough cache is nowhere defined in response headers, it still caches in memory, so going forward and back is fast. Yes, even in case of wikitext files. But looks like it only caches few last pages in memory only because cache is not defined. But what I would like in Firefox is to have visited links of xowa in purple and underlined, just like in normal wikipedia. This was possible in kiwix. Maybe they are not colored and underlined because there is no any cache headers? So I can follow what I read or even what I downloaded (what I read while I was online and allowed internet access and retreival in xowa). Kiwix enabled cache for all files, so I noticed their server is fast. Can you enable cache for all non-html files, and optionally for all files? It's only few HTTP response headers that needs to be done, at least for server/web browsers. This would speed up xowa drastically!

And sorry for mentioning that issue below, that is wrong, don't know how to remove it.

gnosygnu commented 4 years ago

In xowa app noticed that when I go back to previous page via back button, it reloads, which is slow, at least for wikitext files. Can you enable some memory cache, at least few MB or for few articles (pages) to speed this up?

XOWA does do some caching but not at the page-level (template-level). I tried now, and it's fairly quick. Can you try these steps and see if they work for you?

If there is a delay, how long is it?

Luckily I noticed when I use Firefox, even tough cache is nowhere defined in response headers, it still caches in memory, so going forward and back is fast. Yes, even in case of wikitext files. But looks like it only caches few last pages in memory only because cache is not defined.

Yeah, Firefox ultimately relies on the same cache implementation as XOWA app. Whatever we figure out for XOWA app should handle Firefox as well

But what I would like in Firefox is to have visited links of xowa in purple and underlined, just like in normal wikipedia. This was possible in kiwix. Maybe they are not colored and underlined because there is no any cache headers? So I can follow what I read or even what I downloaded (what I read while I was online and allowed internet access and retreival in xowa).

XOWA HTTP Server doesn't handle visited links. XOWA app does though. I could look into this, but it will take some time.

Kiwix enabled cache for all files, so I noticed their server is fast. Can you enable cache for all non-html files, and optionally for all files? It's only few HTTP response headers that needs to be done, at least for server/web browsers. This would speed up xowa drastically!

XOWA HTTP server doesn't use the cache headers. It does try to cache stuff like files, but it limits it to 75 MB. See home/wiki/Special:XowaCfg?grp=xowa.files.general

And sorry for mentioning that issue below, that is wrong, don't know how to remove it.

Yup, no worries

ghost commented 4 years ago

Looks like you are right for switching pages back and forth in xowa app. Except of math. When I go back from 'planet' to 'earth' then it really does not reload all resources. But does reload math, and this takes exactly 9 seconds. I tried it twice, and timing is exactly same. While going forward from 'earth' to 'planet' is quick because there is no math. There is actually 2 to seconds needed to switch between any article, + 6 seconds for math for articles with math calculation. Still not as fast as Firefox. Delay is noticable.

Also would not sending few cache-control headers enable quicker access via server in firefox and allow colored visited links. I can improvies using http debugger, charles proxy, burp suite and similar apps for now.

There is no setting in home/wiki/Special:XowaCfg?grp=xowa.files.general for memory cache, only disk cache, and I increased it to 100 GB both to use manualy image downloading as way to permanently download images. Is there any way to download images faster for two or more articles, for example for whole category or template articles, links which I can copy all manually using firefox extensions like 'copy selected links' and use notepad++ if need to replace start of all links if needed?