dankito / RichTextEditor

Rich text WYSIWYG editor for Android and JavaFX
Apache License 2.0
92 stars 36 forks source link

Image caching issue #7

Closed E-Mans-Application closed 6 years ago

E-Mans-Application commented 6 years ago

Hello,

I implemented a image-upload feature invoked from an option menu item (while I'm waiting for your answer at #5 )

However, the image (5 Mo) loads very slowly, band by band. The editor downloads it every time I load the Html (as I can see in the app's data usage)

I enabled cache:

  editor.setDrawingCacheEnabled(true);
  editor.setPersistentDrawingCache(ViewGroup.PERSISTENT_ALL_CACHES);
  editor.setDrawingCacheQuality(ViewGroup.DRAWING_CACHE_QUALITY_HIGH);

Temporary cache is working: if I add twice the same image (the server does not save it twice and return the same url as before), the image loads almost instantly. But as soon as I close the activity, I re-open it and I load back the html from my database (with setHtml()), the image downloads again. Am I doing something wrong, or is persistent cache not working?

E-Mans-Application commented 6 years ago

The image loading suddenly got much faster. It seems caching now works (surprising) I close the issue.