Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 15    Views: 77

Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
12/18/12 10:19 AM (13 years ago)

Device Cache

So I want a PDF to cache on a device indefinitely, not just until the iPad is turned off.... can this be done (using a URL)... Thanks in advance
 
theMonster
Code is Art
Profile
Posts: 435
Reg: Oct 18, 2011
US
8,050
like
12/18/12 01:11 PM (13 years ago)
So you have a pdf file hosted on your server, and you want to cache it on your users device?
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/18/12 02:34 PM (13 years ago)
Yes it can. Use an URL as you stated. Then make sure as an option for that PDF plugin you have it set for no force refresh-allow cache. If you need somewhere to put your file online try amazon s3.
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 01:55 AM (13 years ago)
yeah I thought I could use the Buzztouch select URL option > Upload file ? Do i need to host it somewhere myself? Thanks for the swift reply guys... Always appreciated. :)
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/19/12 08:14 AM (13 years ago)
Yes, host it somewhere else. Then you paste the URL file link into the URL field in that plugin. Don't select file and download. You can keep your file on Amazon's S3 cloud or similar. There are a bunch out there.The S3 intro package is free.
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 09:56 AM (13 years ago)
Thanks Again for the reply, If i give you the background maybe you could hep further I've made this 'SCS' application for a local business who have engineers dotted around the country. Ive put this app onto 28 different iPads and distributed them around, so i no longer have access to the iPads physically. We now need to update them (putting more documents on the app) I thought this would be okay as i could just make use the Load from URL feature to add more documents and then enable the Document Behaviour > Force Refresh > Allow Caching feature. This Seems to work fine until the engineers are out in the field and need to use the documents when the iPad has no internet connection. For some reason once the app has been closed and re opened it doesn't still keep the 'cached documents' instead it wants to re download them. It also forgets all of the cached documents when it refreshes. As there are over 200 documents its not feasible to go and re-download each one. I think it might have something to do with the Report to cloud URL. So i don't really understand how hosting it somewhere else changes how the iPad is acting?
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/19/12 10:07 AM (13 years ago)
If you are using version 2.0, Buzztouch won't allow you to access the file remotely to update with cache. You have to put it in your own server. V 1.4 allowed this. You have to link it to an outside url link. I think this was done by BT to keep their data usage down.
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 10:22 AM (13 years ago)
Well thats just confusing... How come i can upload documents now and see them on my iPad? It makes sense though. p.s. how much data can you upload to S3 without being charged?
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/19/12 10:31 AM (13 years ago)
AWS Free Tier includes 5GB storage, 20,000 Get Requests, and 2,000 Put Requests http://aws.amazon.com/s3/
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 11:15 AM (13 years ago)
Thanks a lot! Ill give it a go and see where i get....
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 11:32 AM (13 years ago)
Right okay so I've signed up, made a bucket, uploaded a file how do i set the permission so that i can access the file via the URL? EDIT: For anyone following this click Actions > Make Public EDIT: Tested this further got it to work, can see the benefits 1. You can upload a bunch at once. 2. You don't have an 8 Mb restriction BUT it doesn't solve my problem, every time a single new document is added to the application it prompts the user to refresh. After refreshing, ALL of the cached data is lost and everything needs downloading again. Not very time efficient if you have 100 or so documents hosted online that need to be used offline. Thanks for your patience still! But I'm at a loss.
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/19/12 11:43 AM (13 years ago)
Click the box next to the file or folder. Under action you can make it public. Under properties you can copy the link. If you are planning to use it for a bunch of apps I would create a folder system for each app. Then you can have a document folder set to public. Each time you upload files you will need to make that file or the entire folder public again. The default on upload is private.
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
12/19/12 11:46 AM (13 years ago)
I posted a couple of EDIT's above ^
 
Outbreak
buzztouch Evangelist
Profile
Posts: 452
Reg: May 30, 2011
Colorado
14,620
like
12/19/12 11:58 AM (13 years ago)
Try redownloading the source code and compiling. A while back there was a problem with refreshes. It might have something to do with that. Also with caching, they must download the file once for it to work. After that it should remain.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
12/20/12 04:04 PM (13 years ago)
Was interested in this too and just noticed something. If you change something in your panel the app wants to update the config file. After it does it appears the cache has been cleared. I can do anything else including turning of the phone or killing the app and the cached data remains. That would be where to look...
 
Nick Langley
Apple Fan
Profile
Posts: 288
Reg: May 08, 2012
Birmingham, Uni...
11,580
like
01/07/13 04:54 AM (13 years ago)
Okay so heres where I'm at so far... If you press refresh (top right main menu) all app content is refreshed, Cache deleted. If you updated the content, you are prompted to refresh, doing so will result in the cache being deleted. If you want the content to stay cached the only way to do this is to do a final update, tell the users to update when prompted and then Remove the dataURL and reportToCloudURL from the control panel. This will stop the cached pages from looking for new content, it also removes the refresh button. NOTE: You will not be able to update after this without adding the dataURL and reportToCloudURL back on the control panel, re-downloading the source code and updating the app content that way.
 

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.