• Hi all, this plugin is wonderful thank you
    however i’m unable to configure a proper Cache Key Regex since i use a custom fastcgi_cache_key can you help me ?
    Is it even possible to get preload to work with custom key?

    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/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Hasan ÇALIŞIR

    (@psauxit)

    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:

    1. Accept regex patterns that capture the $host in group 1 and the $request_uri in group 2.
    2. Automatically concatenate these two groups internally to form the full URL.

    Please stay tuned for the next update—thank you for your feedback!

    Thread Starter Tiago Bega

    (@tsbega)

    Cool, thanks again for the plugin

    Plugin Author Hasan ÇALIŞIR

    (@psauxit)

    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

    Thread Starter Tiago Bega

    (@tsbega)

    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

    Plugin Author Hasan ÇALIŞIR

    (@psauxit)

    @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
    Thread Starter Tiago Bega

    (@tsbega)

    Here it is

    KEY: httpsGETevoarmg.xxxxxx.netDESKTOP/a-escola/
    KEY: httpsGETevoarmg.xxxxxx.netMOBILE/a-escola/

    Plugin Author Hasan ÇALIŞIR

    (@psauxit)

    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/
    )
Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.