@@ -317,14 +317,31 @@ private function getMetadata($key)
317
317
/**
318
318
* Purges data for the given URL.
319
319
*
320
+ * This method purges both the http and the https version of the cache entry.
321
+ *
320
322
* @param string $url A URL
321
323
*
322
- * @return bool true if the URL exists and has been purged, false otherwise
324
+ * @return bool true if the URL exists with either http or https scheme and has been purged, false otherwise
323
325
*/
324
326
public function purge ($ url )
325
327
{
326
- $ key = $ this ->getCacheKey (Request::create ($ url ));
328
+ $ url2 = 0 === strpos ($ url , 'https:// ' )
329
+ ? preg_replace ('https ' , 'http ' , $ url , 1 )
330
+ : preg_replace ('http ' , 'https ' , $ url , 1 );
327
331
332
+ return $ this ->doPurge ($ url ) || $ this ->doPurge ($ url2 );
333
+ }
334
+
335
+ /**
7AD3
code>
336
+ * Purges data for the given URL.
337
+ *
338
+ * @param string $url A URL
339
+ *
340
+ * @return bool true if the URL exists and has been purged, false otherwise
341
+ */
342
+ private function doPurge ($ url )
343
+ {
344
+ $ key = $ this ->getCacheKey (Request::create ($ url ));
328
345
if (isset ($ this ->locks [$ key ])) {
329
346
flock ($ this ->locks [$ key ], LOCK_UN );
330
347
fclose ($ this ->locks [$ key ]);
0 commit comments