Skip to Content.
Sympa Menu

cc-devel - Re: [cc-devel] REST service and caching or local copy?

cc-devel AT lists.ibiblio.org

Subject: Developer discussion for Creative Commons technology and tools

List archive

Chronological Thread  
  • From: Asheesh Laroia <asheesh AT creativecommons.org>
  • To: Kevin Ollivier <kevino AT theolliviers.com>
  • Cc: cc-devel AT lists.ibiblio.org
  • Subject: Re: [cc-devel] REST service and caching or local copy?
  • Date: Fri, 5 Oct 2007 20:23:11 -0700 (PDT)

On Fri, 5 Oct 2007, Kevin Ollivier wrote:

Hi all,

I'm working on integrating a Creative Commons license chooser into a
wxPython application using ccwsclient, and one thing I'm noticing is
that when using the REST service, there is (expectedly) a brief delay
after switching options. Of course, it can make the application
appear sluggish to those who don't realize it is connecting to the
Internet, and ideally I'd like to make it possible to choose a
license without connecting at all. So I was wondering - is there some
recommended way to cache data or check against the server to see if
there are new options, etc. available?

Hey Kevin,

Glad to see you on cc-devel. I think we met on #cc a few days back.

A naive implementation of a set of Python REST API calls would make the whole app freeze, including making the UI nonresponsive, while the client waits for a response from our API server. A slicker implementation would be event-based and could return immediately, setting up a callback function that will be called so that your app can continue to operate while waiting for the response.

I didn't write the Python wrapper you're using, but my guess it's in the former style. I know I haven't yet answered your question, but in general I just want to mention that event-based programming can make life easier. (Maybe we already do that and I'm just unknowingly promoting our existing work, I haven't checked.)

Looking at http://api.creativecommons.org/docs/readme_15.html , there is no "freshness" measure that I can see. If you were particularly twisted (!), you could download the source to our API and just bundle the smarts of it with your app, distributing updated license information at the same time we do by just watching our Subversion tree.

But that defeats the point of using the API, which is to let you get updated jurisdiction info without releasing an update to your app.

So in summary, "No", we provide no built-in way to let you cache our responses and ensure that you don't keep a stale cache. Nathan Y., maybe you can elaborate on your ideas on if this would be a useful thing to do and if we'll ever get to it given the rest of our workload.

-- Asheesh.

--
To err is human, to purr feline.
To err is human, two curs canine.
To err is human, to moo bovine.




Archive powered by MHonArc 2.6.24.

Top of Page