Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Support purging a staging environment from the PHP client

Aperta
#55 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php
Ambito
api

Direzione di ricerca

Inizia dagli entry point purgeTag(), bulkPurgeTag() e purgeAll() e traccia come l’opzione esistente fastly_soft_purge diventa un header della request. Aggiungi il parametro opzionale staging a questi tre percorsi di purge, lasciando fuori ambito le purge staging di una singola URL, e verifica che le request generate includano Fastly-Purge-Environment quando richiesto, senza modificare il comportamento esistente.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

What I need

An optional parameter on the purge methods that sends Fastly-Purge-Environment: staging, so a purge can be targeted at a service's staging environment:

$options['service_id'] = 'SU1Z0isxPaozGVKXdv0eY';
$options['surrogate_key'] = 'key_1';
$options['fastly_purge_environment'] = 'staging'; // not currently available
$result = $apiInstance->purgeTag($options);

This applies to purgeTag(), bulkPurgeTag() and purgeAll(). Purging a single URL on staging uses a direct connection to the staging IP rather than this header, so it is out of scope here.

Why

Fastly documents this header for exactly those three endpoints in Working with staging. It behaves like Fastly-Soft-Purge, which this client already exposes as an optional fastly_soft_purge parameter, so the change is additive and backwards compatible.

The only workaround today is to wrap the Guzzle client in middleware that injects the header, which means bypassing the SDK for exactly the case a CI pipeline needs it: confirming that an invalidation reached the edge before the change ships to production.

Where this probably belongs

Fastly-Purge-Environment is absent from the Purging API reference — only Fastly-Soft-Purge is listed — so this looks like a gap in the API specification rather than something PHP-specific. The parameter is missing from the other generated clients as well (I checked JavaScript, Rust and Perl). Fixing it in the spec would cover all of them.

Context: I maintain BEAR.QueryRepository, a PHP cache library that has run on Fastly for several years across high-traffic sites.

Lingua principale
PHP
Stelle
26
Fork
31
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di fastly/fastly-php

Tutte le issue di fastly/fastly-php

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.