From 4c1336567c78c61df5f9a05db5029b5c19330e0a Mon Sep 17 00:00:00 2001 From: kristineds Date: Tue, 20 Oct 2015 02:08:51 +0800 Subject: [PATCH 1/2] Add inline documentation for new syntax; See: websharks/zencache#191 --- src/includes/classes/MenuPageOptions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/includes/classes/MenuPageOptions.php b/src/includes/classes/MenuPageOptions.php index 2f8e3c27..526498e3 100644 --- a/src/includes/classes/MenuPageOptions.php +++ b/src/includes/classes/MenuPageOptions.php @@ -611,9 +611,9 @@ public function __construct() echo '
'."\n"; echo '

'.__('Don\'t Cache These Special URI Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are certain cases where a particular file, or a particular group of files, should never be cached. This is where you will enter those if you need to (one per line). Searches are performed against the REQUEST_URI; i.e., /path/?query (caSe insensitive). So, don\'t put in full URLs here, just word fragments found in the file path (or query string) is all you need, excluding the http:// and domain name. A wildcard * character can also be used when necessary; e.g., /category/abc-followed-by-*; (where * = anything, 0 or more characters in length).', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are certain cases where a particular file, or a particular group of files, should never be cached. This is where you will enter those if you need to (one per line). Searches are performed against the REQUEST_URI; i.e., /path/?query (caSe insensitive). So, don\'t put in full URLs here, just word fragments found in the file path (or query string) is all you need, excluding the http:// and domain name. A wildcard * character can also be used when necessary; e.g., /category/abc-followed-by-*; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ = beginning of line, when not used inside square brackets; ** = anything, 0 or more characters in length including all subdirectories; $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; - echo '

'.__('Tip: let\'s use this example URL: http://www.example.com/post/example-post-123. To exclude this URL, you would put this line into the field above: /post/example-post-123. Or, you could also just put in a small fragment, like: example or example-*-123 and that would exclude any URI containing that word fragment.', SLUG_TD).'

'."\n"; + echo '

'.__('Tip: let\'s use this example URL: http://www.example.com/post/example-post-123. To exclude this URL, you would put this line into the field above: /post/example-post-123. Or, you could also just put in a small fragment, like: example or example-*-123 and that would exclude any URI containing that word fragment. To exclude only the front page, put it in a fragment like: ^/$. To exclude a category, e.g. /blog/, and only that category, use ^/blog/$. To exclude all posts and its subdirectories, use a fragment like: ^/post/** and that would exclude any URI in any directory inside /post. To exclude any URI that contains /post/ anywhere, use a fragment like /post/.', SLUG_TD).'

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; echo '
'."\n"; @@ -629,7 +629,7 @@ public function __construct() echo '
'."\n"; echo '

'.__('Don\'t Cache These Special HTTP Referrer Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases where a particular referring URL (or referring domain) that sends you traffic; or even a particular group of referring URLs or domains that send you traffic; should result in a page being loaded on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_REFERER (caSe insensitive). A wildcard * character can also be used when necessary; e.g., *.domain.com; (where * = anything, 0 or more characters in length).', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases where a particular referring URL (or referring domain) that sends you traffic; or even a particular group of referring URLs or domains that send you traffic; should result in a page being loaded on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_REFERER (caSe insensitive). A wildcard * character can also be used when necessary; e.g., *.domain.com; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ where ^ = beginning of line, when not used inside square brackets; ^ where ** = anything, 0 or more characters in length including all subdirectories; $ where $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.__('Tip: let\'s use this example URL: http://www.referring-domain.com/search/?q=search+terms. To exclude this referring URL, you could put this line into the field above: www.referring-domain.com. Or, you could also just put in a small fragment, like: /search/ or q=*; and that would exclude any referrer containing that word fragment.', SLUG_TD).'

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; @@ -647,7 +647,7 @@ public function __construct() echo '
'."\n"; echo '

'.__('Don\'t Cache These Special User-Agent Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases when a particular user-agent (e.g., a specific browser or a specific type of device); should be shown a page on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_USER_AGENT (caSe insensitive). A wildcard * character can also be used when necessary; e.g., Android *; Chrome/* Mobile; (where * = anything, 0 or more characters in length).', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases when a particular user-agent (e.g., a specific browser or a specific type of device); should be shown a page on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_USER_AGENT (caSe insensitive). A wildcard * character can also be used when necessary; e.g., Android *; Chrome/* Mobile; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ where ^ = beginning of line, when not used inside square brackets; ^ where ** = anything, 0 or more characters in length including all subdirectories; $ where $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.sprintf(__('Tip: if you wanted to exclude iPhones put this line into the field above: iPhone;*AppleWebKit. Or, you could also just put in a small fragment, like: iphone; and that would exclude any user-agent containing that word fragment. Note, this is just an example. With a default installation of %1$s, there is no compelling reason to exclude iOS devices (or any mobile device for that matter).', SLUG_TD), esc_html(NAME)).'

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; From 6817a1a35550a38301e6311da4b88abc875e536e Mon Sep 17 00:00:00 2001 From: kristineds Date: Tue, 20 Oct 2015 02:21:18 +0800 Subject: [PATCH 2/2] Add new syntax on CSS/JS exclusion patterns; See: websharks/zencache#191 --- src/includes/classes/MenuPageOptions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/includes/classes/MenuPageOptions.php b/src/includes/classes/MenuPageOptions.php index 526498e3..5baddbd8 100644 --- a/src/includes/classes/MenuPageOptions.php +++ b/src/includes/classes/MenuPageOptions.php @@ -629,7 +629,7 @@ public function __construct() echo '
'."\n"; echo '

'.__('Don\'t Cache These Special HTTP Referrer Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases where a particular referring URL (or referring domain) that sends you traffic; or even a particular group of referring URLs or domains that send you traffic; should result in a page being loaded on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_REFERER (caSe insensitive). A wildcard * character can also be used when necessary; e.g., *.domain.com; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ where ^ = beginning of line, when not used inside square brackets; ^ where ** = anything, 0 or more characters in length including all subdirectories; $ where $ = end of the line.', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases where a particular referring URL (or referring domain) that sends you traffic; or even a particular group of referring URLs or domains that send you traffic; should result in a page being loaded on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_REFERER (caSe insensitive). A wildcard * character can also be used when necessary; e.g., *.domain.com; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ = beginning of line, when not used inside square brackets; ** = anything, 0 or more characters in length including all subdirectories; $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.__('Tip: let\'s use this example URL: http://www.referring-domain.com/search/?q=search+terms. To exclude this referring URL, you could put this line into the field above: www.referring-domain.com. Or, you could also just put in a small fragment, like: /search/ or q=*; and that would exclude any referrer containing that word fragment.', SLUG_TD).'

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; @@ -647,7 +647,7 @@ public function __construct() echo '
'."\n"; echo '

'.__('Don\'t Cache These Special User-Agent Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases when a particular user-agent (e.g., a specific browser or a specific type of device); should be shown a page on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_USER_AGENT (caSe insensitive). A wildcard * character can also be used when necessary; e.g., Android *; Chrome/* Mobile; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ where ^ = beginning of line, when not used inside square brackets; ^ where ** = anything, 0 or more characters in length including all subdirectories; $ where $ = end of the line.', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases when a particular user-agent (e.g., a specific browser or a specific type of device); should be shown a page on your site that is NOT from the cache (and that resulting page should never be cached). This is where you will enter those if you need to (one per line). Searches are performed against the HTTP_USER_AGENT (caSe insensitive). A wildcard * character can also be used when necessary; e.g., Android *; Chrome/* Mobile; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ = beginning of line, when not used inside square brackets; ** = anything, 0 or more characters in length including all subdirectories; $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.sprintf(__('Tip: if you wanted to exclude iPhones put this line into the field above: iPhone;*AppleWebKit. Or, you could also just put in a small fragment, like: iphone; and that would exclude any user-agent containing that word fragment. Note, this is just an example. With a default installation of %1$s, there is no compelling reason to exclude iOS devices (or any mobile device for that matter).', SLUG_TD), esc_html(NAME)).'

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; @@ -752,11 +752,11 @@ public function __construct() echo '

'."\n"; echo '
'."\n"; echo '

'.__('CSS Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases when a particular CSS file should NOT be consolidated or compressed in any way. This is where you will enter those if you need to (one per line). Searches are performed against the <link href=""> value, and also against the contents of any inline <style> tags (caSe insensitive). A wildcard * character can also be used when necessary; e.g., xy*-framework; (where * = anything, 0 or more characters in length).', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases when a particular CSS file should NOT be consolidated or compressed in any way. This is where you will enter those if you need to (one per line). Searches are performed against the <link href=""> value, and also against the contents of any inline <style> tags (caSe insensitive). A wildcard * character can also be used when necessary; e.g., xy*-framework; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ = beginning of line, when not used inside square brackets; ** = anything, 0 or more characters in length including all subdirectories; $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; echo '

'.__('JavaScript Exclusion Patterns?', SLUG_TD).'

'."\n"; - echo '

'.__('Sometimes there are special cases when a particular JS file should NOT be consolidated or compressed in any way. This is where you will enter those if you need to (one per line). Searches are performed against the <script src=""> value, and also against the contents of any inline <script> tags (caSe insensitive). A wildcard * character can also be used when necessary; e.g., xy*-framework; (where * = anything, 0 or more characters in length).', SLUG_TD).'

'."\n"; + echo '

'.__('Sometimes there are special cases when a particular JS file should NOT be consolidated or compressed in any way. This is where you will enter those if you need to (one per line). Searches are performed against the <script src=""> value, and also against the contents of any inline <script> tags (caSe insensitive). A wildcard * character can also be used when necessary; e.g., xy*-framework; (where * = anything, 0 or more characters in length). These other special characters can also be used: ^ = beginning of line, when not used inside square brackets; ** = anything, 0 or more characters in length including all subdirectories; $ = end of the line.', SLUG_TD).'

'."\n"; echo '

'."\n"; echo '

'.__('Note: please remember that your entries here should be formatted as a line-delimited list; e.g., one exclusion pattern per line.', SLUG_TD).'

'."\n"; echo '
'."\n";