1

I would like to add a cache layer to my app for questions, answers and comments.
The last_activity_date parameter on /questions route seems a valid candidate (probably the only way available)
The help says:

"last_activity_date": {
     "description": "last time this post had any activity",
     "values": "unix epoch date, range [0, 253,402,300,799]",
     "optional": true
 }

What do you mean with any activity?
What kind of events modify this date?

1 Answer 1

1

Activity is defined as, "whatever the site considers Activity." Yeah...

More usefully, the current list is:

  • edits (on the post themselves, and on an answer a question owns)
  • opening a bounty
  • a new answer
  • initial creation

Basically, if it "bumps" a question its activity.

7
  • @Kevin uhm, as suspected it does not consider the comments. Do you know where to look at this information? I would like to be sure that people using StackPrinter print also the new comments. Commented Oct 30, 2010 at 4:09
  • 1
    @systempuntoout - query /posts/{id}/comments. It'll accept a set of mixed question and answer ids, and has a creation sort (with associated min/max parameters). Comment edits will be missed, but those are exceedingly rare (and excepting moderators/developers, can only occur within 5 minutes of a comments creation; so you can grab them with a a modifier on min). Commented Oct 30, 2010 at 4:16
  • @Kevin well, vectorized parameters are limited, isn't it? Your solution won't work for questions with hundreds of answers :( Commented Oct 30, 2010 at 16:38
  • @systemputoout - if you're looking to keep a copy of SO up to date, it is rather difficult. If you're looking to keep a small subset (say, the last 100 q/a's printed) its perfectly tractable. Commented Oct 30, 2010 at 19:34
  • @Kevin yes, the last 100 q/a's printed are enough. But how could I achieve that if vectorized parameter has an upper limit? (more than one query just to check if comments are changed is out of discussion, in that case I would give up the caching idea) Commented Oct 30, 2010 at 20:55
  • @systempuntoout - the limit on vectorized ids is 100... maybe I'm not following, but it seems to me if you're already tracking the last hundred total question and answers (that is # q's + # a's = 100) printed it should just be 1 API query to get any new/modified (excepting moderator modifications) comments on them. Commented Oct 30, 2010 at 22:19
  • @Kevin moved the topic here Commented Oct 31, 2010 at 10:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .