File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ enum HeaderEnum: string
66{
77 case CACHE_TAG = 'Cache-Tag ' ;
88 case CACHE_PURGE_TAG = 'Cache-Purge-Tag ' ;
9- case CACHE_PURGE_PREFIX = 'Cache-Purge-Prefix ' ;
109 case CACHE_CONTROL = 'Cache-Control ' ;
1110 case CDN_CACHE_CONTROL = 'CDN-Cache-Control ' ;
1211 case SURROGATE_CONTROL = 'Surrogate-Control ' ;
Original file line number Diff line number Diff line change @@ -292,24 +292,6 @@ public function purgeTags(string|StaticCacheTag ...$tags): void
292292 ]);
293293 }
294294
295- public function purgeUrlPrefixes (string ...$ urlPrefixes ): void
296- {
297- $ urlPrefixes = Collection::make ($ urlPrefixes )->filter ()->unique ();
298-
299- if ($ urlPrefixes ->isEmpty ()) {
300- return ;
301- }
302-
303- Craft::info (new PsrMessage ('Purging URL prefixes ' , [
304- 'urlPrefixes ' => $ urlPrefixes ->all (),
305- ]), __METHOD__ );
306-
307- // TODO: make sure we don't go over max header size
308- Helper::makeGatewayApiRequest ([
309- HeaderEnum::CACHE_PURGE_PREFIX ->value => $ urlPrefixes ->implode (', ' ),
310- ]);
311- }
312-
313295 private function isCacheable (): bool
314296 {
315297 $ response = Craft::$ app ->getResponse ();
Original file line number Diff line number Diff line change 88
99class StaticCacheController extends Controller
1010{
11- public function actionPurgePrefixes (string ...$ prefixes ): int
12- {
13- $ this ->do ('Purging prefixes ' , function () use ($ prefixes ) {
14- Module::getInstance ()->getStaticCache ()->purgeUrlPrefixes (...$ prefixes );
15- });
16-
17- return ExitCode::OK ;
18- }
19-
2011 public function actionPurgeTags (string ...$ tags ): int
2112 {
2213 $ this ->do ('Purging tags ' , function () use ($ tags ) {
You can’t perform that action at this time.
0 commit comments