Document pantheon_clear_edge_keys(), pantheon_clear_edge_paths(), & pantheon_clear_edge_all()

Created on 25 August 2023, 10 months ago
Updated 12 September 2023, 10 months ago

Problem/Motivation

PHP interactions with Pantheon edge are handled by the following custom PHP functions: pantheon_clear_edge_keys(), pantheon_clear_edge_paths(), & pantheon_clear_edge_all(). So far as I can tell, they're undocumented.

Proposed resolution

Publicly document these three functions, along with any others that may exist.

Remaining tasks

  • Document aforementioned functions.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ’¬ Support request
Status

Active

Version

2.1

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States Chris Burge

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Chris Burge
  • πŸ‡ΊπŸ‡ΈUnited States Chris Burge

    The functions can be found in /srv/includes/pantheon.php (download via SFTP). Interestingly, one of the comments in the file indicates at least one of these functions used to be documented at https://pantheon.io/docs/articles/architecture/edge/varnish/caching-adva....

    Draft docs below (in docblock form):

    /**
     * Invalidates surrogate keys from the edge cache.
     *
     * Surrogate keys are collected in static cache. Later, a single request is
     * made to the edge cache in a shutdown function.
     *
     * @param array $keys
     *   An array of surrogate keys.
     *
     * @throws InvalidArgumentException
     */
    function pantheon_clear_edge_keys(array $keys = array()) { }
    
    /**
     * Invalidates specific paths from the edge cache.
     *
     * Requests are made to edge cache when this function is called. (i.e. They are
     * not collected and sent at the end of the request in a shutdown function.)
     *
     * @param array $paths
     *   An array of paths.
     *
     * @throws InvalidArgumentException
     */
    function pantheon_clear_edge_paths($paths=array()) { }
    
    /**
     * Invalidates the entire edge cache.
     *
     * @throws InvalidArgumentException
     */
    function pantheon_clear_edge_all() { }
    

    I think the important takeaway is that surrogate keys are batched and paths are not.

    As a performance enhancement, pantheon_clear_edge_paths() could batch and then send in a shutdown function like pantheon_clear_edge_keys.

  • πŸ‡ΊπŸ‡ΈUnited States Chris Burge
Production build 0.69.0 2024