makeImageRequest => caching?

Hi all,

I have a question regarding "makeImageRequest": how exactly is the caching done? I have an application which in some cases needs to update an icon every few seconds to assure a changed status is visualized. On the simulator this works fine, I guess because there no proxy is used. On the device however it does not work in a consistent way. The icon seems to update in one call but in the next one it suddenly falls back to the previous icon again. My assumption is that the proxy does some caching but I need a confirmation. Also, is there a way to disable the caching entirely? The webserver is sending a "no-cache"-header already, but this does not seem to make any difference.

Any suggestions?

Thanks!

  • What device are you using to test?  A CIQ 4 device with the graphics pool?

  • I am currently using a Fenix 7, so yes, CIQ4. But I would also like to support older devices, if possible. Is there something in CIQ4 that can help?

  • CIQ 4 has the graphics pool so that could be involved with what you are seeing.  What happens when you try a CIQ 3 device?  You are seeing this in the sim, correct?

  • I have no CIQ3 device for testing. And yes, correct behavior is visible in the simulator.

  • I don't know what is connection between graphic pool and webReq. If I have a picture I simply draw it on screen.

    The problem is that icon is not correct. Probably on computer you can observe almost real time icon {using for example web socket or direct connection from JavaScript) but in Garmin solution is at least 2 proxies GC and Garmin server converting respond). And of course you need some time for calling onRecive. So if all process takes e.g. 5 second and icon can change 3 times you can't see current.

    Maybe you should make 'average' icon on server.

    Or write companion app that use socket and use phone message to inject current value to watch.

  • ok, then I think you got my requirement wrong. I will try to explain more in detail:

    - the app I am talking about is dealing with automated homes

    - every device has a current status (e.g. a lamp => on/off)

    - some devices can also have more states (e.g. garage door: open/closing/closed/opening)

    - changing a state is an asynchronous process

    - taking the example of garage door:

      - the door is closed

      - via device (Fenix 7) I execute "open" action

      - the first icon I receive is "opening"

      - after some time (round about 20 seconds) the state changes to "closed" and icon changes accordingly

    What I require is the device to constantly check for the newest icon as the icon at some point changes to "closed" which means the final state is reached. This works fine in the simulator but on device the behavior is as follows:

    - I select "open" action

    - device shows "opening" icon

    - after 2 seconds (next icon request) suddenly icon changes to "closed" again

    - icon keeps to be "close" until after about 20 seconds it changes to "open"

    Somehow there is a caching in place which I cannot determine at the moment.

    Hope that clears it up.

  • On 4.x devices, when you do a makeImageRequest, the graphics pool is involved, as that's where the image ends up.  Not in the app's own memory as on 3.x devices and earlier

  • I've thought it is something that.

    So first thing is not sending image but, I think faster small json, and icon choose on device.

  • Maybe you are right but rather involved after data is already on device. And gpu should rather speed up process.

  • Or divide requests for

    - fast respond getCurrentStatus

    - make something and show icon in progress and server responds after timeout or then process ends