×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    25

    How to disable image caching in WRT widget

    Hi all. I'm writing WRT widget which display at homescreen some images from phones file system. Native application updates that images, and to get rid of "Allow application to access user data" new images overwritten to same file. Images updated by javascript
    Code:
    image.src = "some_file_path";
    It all works fine on C7-00 and C6-00, but on N8 and X7-00 images not updated. I've tried to use 2 files and to switch between them, but image shows first values of that files, and not shows updated content.
    So my question is how to disable caching of the image content?
    Thanks in advance!

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: How to disable image caching in WRT widget

    Hi,

    I was about to suggest appending a random query string to the src, but that does not seem to work for local files.

    I'm just wondering about the prompt that you wan't to get rid of. If you are placing a widget to home screen, the only prompt is "allow application to access phone data?". You cannot avoid this prompt, but if user says yes then you can use platform services without additional prompts.

    By the way what are browser versions for C7, C6 and respectively N8 and X7? Just in case this is browser version depended issue.

    Br,
    Ilkka

  3. #3
    Nokia Developer Champion
    Join Date
    Feb 2011
    Location
    bucharest
    Posts
    149

    Re: How to disable image caching in WRT widget

    the only solution I see is:
    the native should write randomName files and a src.html in witch is a <img src="12345.jpg" /> where 12345 is the random; probably the native should erase the old random files too
    then in your WRT het that src.html text with AJAX

    also you could try as isalento said.. with a random querry, because it might work...

    Code:
    image.src = "some_file_path/img.jpg?rnd="+Math.random();
    Quote Originally Posted by teskterrus View Post
    Hi all. I'm writing WRT widget which display at homescreen some images from phones file system. Native application updates that images, and to get rid of "Allow application to access user data" new images overwritten to same file. Images updated by javascript
    Code:
    image.src = "some_file_path";
    It all works fine on C7-00 and C6-00, but on N8 and X7-00 images not updated. I've tried to use 2 files and to switch between them, but image shows first values of that files, and not shows updated content.
    So my question is how to disable caching of the image content?
    Thanks in advance!

  4. #4
    Registered User
    Join Date
    Sep 2011
    Posts
    25

    Re: How to disable image caching in WRT widget

    Hi guys! Thanks a lot for your answers! I've found one more way - it is to use base64 encoded images, which are transferred with APIBridge.
    Code:
    image.src = "data:image/bmp;base64,J3QQ4AndOtherImgData.......";

Similar Threads

  1. Disable QML's XMLHttpRequest caching?
    By loellanthony in forum [Archived] Qt Quick
    Replies: 2
    Last Post: 2011-05-21, 11:28
  2. Replies: 1
    Last Post: 2011-03-19, 14:22
  3. Caching and image, possible?
    By zing in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-05-11, 12:43
  4. Image caching
    By pillar in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-07-28, 00:06

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×