Support purging a staging environment from the PHP client
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 72/100
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di fastly/fastly-php
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
fastly/fastly-php#53 · 1 commento ·
Tutte le issue di fastly/fastly-php
Issue simili
-
Bug-Report
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RSS-Bridge/rss-bridge#5158 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
octobercms/october#6150 ·
-
Syntax error with CONST-sAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
flarum/framework#5301 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Add TuneIn-DirMon in the bot listForse già presa @liviuconcioiu l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
matomo-org/device-detector#8424 ·
I maintainer di solito rispondono entro 1 giorno