Purge batch of surrogate keys



  • Leon Brocard

    Hi sky,

    You can only purge one key per request, so you'd have to make 100 requests.

    However, this suggests that perhaps you could have set a common surrogate key on all these objects? That would allow you to purge them with one request.

    Regards, Léon

  • sky


    Those 100 keys are chosen from a pool of 1000 keys based on custom logic, and are always different.

    IT WOULD BE VERY USEFUL TO HAVE THE FUNCTIONALITY OF PURGING BATCH OF SURROGATE KEYS. It would be both more easy to purge, and more FASTLY since it would go trough all cached objects once with all the batch.

  • Leon Brocard

    Thanks for the suggestion. That seems like a reasonable feature and I've passed it on to our development team.

    Regards, Léon

  • Peter Wohlers

    I guess it should also be noted that you can have multiple surrogate-keys per object, up to 16kB of keyspace for keys with a 1kB max size for a single key, so batches might not necessarily be needed if you wanted to do things like tag objects with oh...let's say "css" , "/static" , "build1234" , "v-day" and/or "10Jan2016", it might be easy to create logical groupings that minimize the need for multiple purges.


  • sky


    Peter thanks for the suggestion, however we cannot create logical groupings since the resources needed to be purged are dynamic.

  • wimleers

    Echoing the need for this. Drupal 8 has built-in support for cache tags, which is effectively identical to Fastly's cache tags. Drupal 8 very often needs to invalidate multiple cache tags (~ surrogate keys) at the same time.

  • Chaim Klar

    +1 waiting for this feature

Please sign in to leave a comment.