Hello @tsbega
The current cache key regex option is restrictive because it expects the $host$request_uri
to be returned in a single capture group matches[1]. To improve flexibility and user experience, I will implement an update to version 2.0.9 that will allow users to separate the host
and request_uri
into two distinct capture groups.
This enhancement will make it easier for users to parse complex cache keys like $scheme$request_method$host$device$request_uri
without having to condense everything into one capture group.
With v2.0.9 plugin will:
- Accept regex patterns that capture the
$host
in group 1 and the $request_uri
in group 2.
- Automatically concatenate these two groups internally to form the full URL.
Please stay tuned for the next update—thank you for your feedback!
Cool, thanks again for the plugin
Hello @tsbega
v2.0.9 live now ! Thank you for your feedback again.
- Relaxed cache key regex options to allow parsing into two capture groups for increased flexibility (Tiago Bega)
my fastcgi_cache_key is $scheme$request_method$host$device$request_uri
My keys looks like this
KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/
KEY: httpsGETevoarmg.xxxxxx.netMOBILE/
Please use the regex below for your custom fastcgi_cache_key to ensure the full functionality of NPP !
/^KEY:\s+https?(?:GET)?([^\/]+)(?:DESKTOP|MOBILE)(\/[^\s]*)/
Let me know if the regex works for you !
Best~Hasan
Hi, preload still does not work and i get following error
Displaying Cached Content
ERROR REGEX: Please check the Cache Key Regex option in the plugin Advanced options section and ensure the regex is configured correctly.
checked on both versions
@tsbega could you send me one of the KEY:
lines from the cached content that includes the request_uri
?
KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/
KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/request_uri
Here it is
KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/a-escola/
KEY: httpsGETevoarmg.xxxxxx.netMOBILE/a-escola/
Hello @tsbega
preg_match('/^KEY:\s+https?(?:GET)?([^\/]+)(?:DESKTOP|MOBILE)(\/[^\s]*)/', $input_line,
$output_array);
array(3
0 => KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/a-escola/
1 => evoarmg.xxxxxx.net
2 => /a-escola/
)
array(3
0 => KEY: httpsGETevoarmg.xxxxxx.netMOBILE/a-escola/
1 => evoarmg.xxxxxx.net
2 => /a-escola/
)