Discussion Forums  >  Images, Documents, File Locations

Replies: 7    Views: 112

basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
04/27/12 12:55 PM (13 years ago)

how do I force certain images to load from server not cache (iOS)

I have traffic cams in an app that show the latest traffic images when opened. Trouble is, if the app's left open, they don't update when clicked on. How can I force the app to get current images when the camera icon is clicked? The page is a "custom html (text)" screen in BT 1.5, which uses local images except for when one of the 4 cam icons is clicked, when it accesses remote images to show the traffic cam image in a modal overlay.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/27/12 01:19 PM (13 years ago)
For the screen that contains the traffic cam image, you can configure "Force Refresh" in the Advanced Properties for that screen.
 
basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
like
04/27/12 01:44 PM (13 years ago)
that doesn't do the trick. If I stay on the page, I'm not reloading or refreshing it, I need the links, when clicked to reload up to date images, not just use the ones that were there when that page was originally loaded. Here's the free app, if you want to check out what I mean: http://itunes.apple.com/ca/app/dutyfree/id482152137?mt=8 and it's the top left icon (you may need to refresh the menu if you see a list, not icons...I've got a fix for this going up soon) As a temporary fix, I've added a reload button, but I'd rather have it fetch the up to date image automatically. thanks
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/27/12 02:09 PM (13 years ago)
That's a darn nice looking app! What sort of screen do you use to display the cam image? If it's an HTML screen, I think you can also set a refresh rate on the page using HTML. I'd have to research that a bit. Mark
 
basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
like
04/27/12 02:13 PM (13 years ago)
I can do a refresh, yeah, I wanted to keep it clean with a force load of the traffic cam images though if possible. Thanks, there are more updates in the works that will make it even prettier!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/27/12 02:24 PM (13 years ago)
This might help if you're using an HTML screen: http://en.wikipedia.org/wiki/Meta_refresh
 
MQCMobile
Lost but trying
Profile
Posts: 85
Reg: Feb 13, 2011
Oklahoma
5,950
like
04/27/12 08:34 PM (13 years ago)
You could google around an try a NSTimer instance that could work.
 
basement
Aspiring developer
Profile
Posts: 488
Reg: Apr 07, 2011
Ontario
4,880
like
05/01/12 04:19 AM (13 years ago)
I got it solved..... adding this to the header fixed it. The problem was that I am using JQuery on the page, and apparently that needs a special 'no cache' script: <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script> <script type="text/javascript"> $(function(){ $('img').each(function(){ var img=this,src=img.src setInterval(function(){img.src=src+'?'+(new Date())}, 60000 ) }) }) </script>
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.