Image Gallery

Hi Dmitry,

This is understandable, but… when we change the image, and click the Refresh button in the app at design time where we define the URL, surely the expectation is to flush the cache and fetch the image again? If, not what is the refresh button for?

I just updated 7 images that I use in an image gallery widget. No URL changes. 2 out of the 7 images have updated themselves. I have clicked the refresh on all 7 and I have tried editing the URL and setting it back again on one that won’t update to no avail.

furthermore, explicitly setting the urls via

Blynk.setProperty(V20, "urls", "https://s3.amazonaws.com/etc/etc");

also does not flush the cached images/

and the cache seems to be global too…

I added a new picture gallery to a new app, added one of the cached URLs, and it shows the old cached copy there also.

I have separately fetched the image via HTTP and verified it has been updated on the server.

I can provide the urls via private message. They are gif files hosted on amazon.

Please provide urls so we can check them. Maybe they are just not available. @BlynkAndroidDev FYI.

Yep, of course, we are caching them, so they wouldn’t be downloaded every time. Ill remove cache for images reload logic in the image widget settings, so it will be possible to refresh them after a change

1 Like

sounds great - thanks. That will resolve my issue.

For others, though, I am wondering if a “flush” command may also be needed, such as
.setProperty(V20, “flushcache”…);

If someone wants to view a webcam and they have some other script updating the image, they will need to be able to flush the cache from code…

or

a no-cache option in the widget.

Yep, there should be some cache option in the widget, for sure. We’ll think about that

1 Like

Yep, that’s a good idea to flush saved images on setProperty - I’ll implement it for nearest 2.27.2 release.

3 Likes

no news about image buttons widgets ? :thinking:

No new widgets at least during winter

1 Like

so, after the 20th of March :star_struck:
that’s a good news indeed Alexander !

is this for python? because I am not even able to use the setProperty in the python code…

FYI, I am not sure if the cached images invalided themselves after some days, or if you flushed them, but the new copies of the hosted files are now appearing in my app…
Flush/refresh still needed though… just adding the info that they did come right eventually.

It will be available in 2.27.2 beta soon, like you proposed in urls set property command or refreshing image in its settings.

3 Likes

I’m sorry but that includes IOS devices or only Android? Thanks

only Android

That’s odd, this post is for iOS also in android it updates automatically when the url change, at least for my 2 android devices that I’ve checked.
I suppose that if there is a lib update instead of app update it might be beneficial for the iOS devices too. Idk if that’s possible though.

the caching is taking place on the server. So when the caching is improved it works for all clients.

1 Like

Hi all,

We just uploaded new beta release with 2.27.2 version with a fix to this issue:

  • “set property urls” command should refresh images memory cache
  • editing/refreshing image in image widget’s settings will refresh its memory cache too
3 Likes

Good job Alexander !!