How can I cache a list of entries with pending postDates and have it automatically invalidate the cache appropriately? I have a listing page of entries, some of which may have future-dated postDates. I want to cache the output, but only until one of the pending entries goes live.
Easy! Get the most soonest upcoming pending entry, and use until:

{% set firstPending = craft.entries({
  section: 'articles',
  status: 'pending',
  order: 'postDate asc'
}).first %}
{% set cacheUntil = firstPending ? firstPending.postDate : now|date_modify('+1 year') %}

{% set content %}
    {% cache until cacheUntil %}
        ...
    {% endcache %}
{% endset %}


Note that this solution requires Craft 2.2.2598 or later.