Hacker News new | ask | show | jobs
by digitallimit0 5246 days ago
For the Lanyrd team: when exactly are you caching the data? Is the expectation that I browse the events I'm going to attend in advance while logged into the app and you dump all viewed events into localStorage? As well, on first visit to the site I imagine you have some sort of if-storage-is-empty-and-logged-in dump to get the site scripting and design in there, and then just feed off of that afterward?

I'd love to hear more of the technical side as I'm just getting into HTML5 but I haven't sunk my teeth into some of the crazier aspects outside of playing with canvas and familiarizing myself with JavaScript and its associated libraries.

1 comments

You're not far off...

To cache everything you're tracking/attending visit http://m.lanyrd.com/calendar/yours/ - the root url redirects here if you're logged in.

The data for each conference is versioned, you can see the version number as data attributes on each list item. If the data you have doesn't match that version number, a few XHR requests are triggered to fetch the latest data.

Also, if you look at a conference page you're tracking or attending while online, we do a data-version check for that conference and update if needed.

I'm writing up an article on all the troubles we had with ApplicationCache, for there were many. LocalStorage was extremely simple & useful though.

I'm in the middle of a short build (~5 days) mobile app that is using app cache and annoyingly I can't see to get it working on iOS, all the standard web browsers seem fine but iOS is being a PITA. I don't suppose you have any top tips?

That said more technical details would be awesome - I'd love to see how other people are doing things like this!

We didn't have to do anything special to get offline stuff working in iOS, sounds like we're lucky we didn't hit the problem you're having.

Here's a simple demo that works in iOS http://appcache-demo.s3-website-us-east-1.amazonaws.com/xhr/ - that might make it easier to see what you're doing differently. Are you serving the manifest with the correct content-type header, for instance?

Thanks for that its really appreciated!
Jake has an article in the works that will go in to this stuff in much more detail - keep an eye on http://lanyrd.com/blog/ for the link when he finishes it.