-
-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server-side image caching of images being used in articles #2532
Comments
Well, the downloading image feature just landed in the 2.2 branch.
Which means, if downloading images is enabled on the wallabag instance, the Android app will receive all img src targetting the wallabag instance. This is for the downloading part on the server side. What Reeder does?
If you don't enable that feature, image are downloading on the fly when you open an article. Why not implementing the same feature on the Android / iOS app? |
What happens to the JSON Export with that feature in wallabag core? Does it still contain original links or links to my wallabag instance for the used pictures in the articles? Now, it is WIP in android app: wallabag/android-app#343 |
Since the behavior is to replace original link in html by the one to the wallabag instance, everything related to the content will got image link to the wallabag instance. Good job on the Android part 👍 |
This was supported in 1.9 if I remember right. iw as able to cache the images locally. Is there any reason why that feature was not carried over to the new version? |
@j0k3r Thank you. So there is no possibility to just get my json export from my instance 1, go to my wallabag instance 2 and restore all articles? Because i also have to carry over my cached images since the articles in json export do not contain the original image links anymore? |
This issue is closed since we merged PR #2180 |
As request by @tcitworld in the gitter chat, this is ticket for the feature request of server-side caching of images.
Summary
When downloading an article with wallabag, all images being used in the article shall be downloaded, too. How they are saved is implementation detail and not clear to me.
Issue details
Suppose i add an article to my wallabag. The article content is then saved to the database. But only the text is saved. If i open an article in wallabag core, always all images need to be requested again.
Inspired by ttrss the images are cached in the folder
cache/images/somehash.jpg
. I do not know how the hash is calculated. But to avoid name clashes between articles maybe articleURL+imageURL should be hashed. Or a separated subfolder for each article id? But even then name clashes can occur.Or one could save the images as blob in the database.
When we downloaded the images of an article, all article's image tags need to be rewritten to let their src's attributes point to the cached image now.
API
The cached images should be exposed by the API somehow, so that 3rd-party apps like Android can download images directly from wallabag without contacting all the article sites.
Q: so the core api should give the list of pictures inside the articles ?
A: if the wallabag core alreday caches images in a certain format, maybe yes, the links to the according files (e.g. cache/image/hash1.jpg cache/image/hash2.jpg etc)
Reloading of article
If i click on the refetch button in the article view, do the images need to be refetched? Maybe for performance not, because the chance is high that a subset of the images is still in the article. Maybe for stability yes to be always consistent.
Why
gitter chat log
left in this ticket just for reference:
The text was updated successfully, but these errors were encountered: