Skip to content

Instantly share code, notes, and snippets.

@wgkoro
Last active February 19, 2016 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wgkoro/4702394 to your computer and use it in GitHub Desktop.
Save wgkoro/4702394 to your computer and use it in GitHub Desktop.
Nginx Proxy Cache Purge用のパッチ。 スマホやガラケー用のキャッシュをpurgeさせるためのURL(/pg_s/xxx, /pg_f/xxx)にも同時にアクセスさせる。
*** nginx-proxy-cache-purge_org.php 2012-04-09 06:22:30.000000000 +0900
--- nginx-proxy-cache-purge_new.php 2013-02-04 00:35:13.000000000 +0900
***************
*** 13,18 ****
--- 13,20 ----
$link = get_permalink($post_id);
$parse = parse_url($link);
$post_url = $parse[scheme].'://'.$parse[host].'/purge'.$parse[path];
+ $post_url_sp = $parse[scheme].'://'.$parse[host].'/pg_s'.$parse[path];
+ $post_url_ft = $parse[scheme].'://'.$parse[host].'/pg_f'.$parse[path];
#home page purge url
$home_page = home_url();
***************
*** 39,44 ****
--- 41,48 ----
#array of purge urls
$urls = array(
$post_url,
+ $post_url_sp,
+ $post_url_ft,
$home_page_url,
$feed_url,
$comments_feed_url,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment