Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter kochtopf

    (@kochtopf)

    To get background regeneration to work – here is a quick patch:
    diff advanced-cache.php

    87c187,188
    < self::clean_request();

    > pj_sapi_headers_clean();
    >
    202c203
    < return ( php_sapi_name() == ‘fpm-fcgi’ && function_exists( ‘fastcgi_finish_request’ ) );

    > return ( php_sapi_name() == ‘fpm-fcgi’ && function_exists( ‘fastcgi_finish_request’ ) && function_exists( ‘pj_sapi_headers_clean’ ) );

    Plugin Contributor Pressjitsu

    (@pressjitsu)

    It’s part of an internal custom PHP module that we run, we’ll likely open source it in the future, but for now your patch might cause more problems.

    The pj_sapi_headers_clean function is quite essential, because when you served a request from cache, you already sent some headers from that cached entry. These headers will be present in PHP’s headers_list and ultimately merged with the updated headers.

    Thread Starter kochtopf

    (@kochtopf)

    we’ll likely open source it in the future

    Yaiks! Would be great!

    your patch might cause more problems

    I’ve checked the headers – all OK. The dynamic headers are done at the edge (‘m using cloudflare) the rest is static.
    Thank you very much for this plug. It really saves a lot of CPU cycles on my little RaspiPI.
    Next step – patch in RedisArray support (any plans on this one?). I’ve tried but still struggling with multi()… [Oh sorry, that was off topic -> feature request ?? ]

    Plugin Contributor Pressjitsu

    (@pressjitsu)

    No plans for RedisArray support, not sure why we’d need it either, but let us know what you come up with! ??

    Thread Starter kochtopf

    (@kochtopf)

    not sure why we’d need it

    Say your server has not enough RAM to hold all pages but you have another server idling around (hot backup in my case). One can use this RAM as an additional transparent cache. I’ve tried RedisCluster but phpredis needs at least 3 master server to build a cluster.
    PS: I’ve got it working but still struggling with ‘autorehash’. This is not yet working (maybe over my pay-grade. let you know…)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Serving stale cache pages’ is closed to new replies.