Redis Cache By Xon

Redis Cache By Xon 2.17.2

No permission to download


Well-known member
Xon submitted a new resource:

Redis - XenForo + Redis

This add-on uses Credis with a custom cache provider for Redis. For best performance, install the php extension: phpredis


Please be aware that Redis is very sensitive to latency in a virtual environment. If repeated connection failures or protocol errors are experienced disable any Redis...

Read more about this resource...
Xon updated Redis Cache By Xon with a new update entry:

1.1.0 - BC Maintenance update

  • Switch to using json encode/decode for serialization, may not round-trip 100% correctly but by design.
    • As this add-on is used to cache potentially untrusted data, serialize/unserialize are strongly not recommended.
  • Replace Doctrine Cache key mangling. The practice of injecting [ and ] into key names makes working with redis-cli annoying (most linux shells require [ or ] to be escaped in a confusing list of situations), and requires further escaping when using...

Read the rest of this update entry...
@Xon for this, we should wait until we upgrade to XenForo 2?
We can not upgrade to this addon till we have xenforo 1.5
There's a strange bug with this on the beta @Xon.

(Well, it may have been before the beta, but I'm only noticing it with the beta).

If the cache is enabled, and caching sessions is also enabled, then any errors on the registration form result in the user being directed back to the registration form with no indication of anything.

This may be an XF issue with caching in general though.

Ah, I was actually getting errors logged:

ErrorException: Undefined property: XF\DataRegistry::$dnsBlCache src/XF/Spam/Checker/AbstractDnsBl.php:10

Could you see if it's an issue with your cache provider? If not I'll start a bug report thread.


Looking at the values in redis, it would seem json_encode doesn't store the session at all.

This also results in a new (empty) session being created, and stored in redis on every page load.

Looking at the values in redis, it would seem json_encode doesn't store the session at all.
Damn, stupid utf8 string & binary data :(

I'll guess I'll need to revert that. You might need to deploy the code, flush the cache, then install
Xon updated Redis Cache By Xon with a new update entry:

2.0.2 - Maintenance release

  • Support storing gz'ed encoded data raw in Redis and passing that to the client rather than decompression & recompression in php.
    • If the client doesn't support gz'ed data, it is decompressed and sent.
  • Workaround XF2.0 Beta 1 bug which disable any sort of caching for CSS
    • Css generation to be cache is independent of sending the flags to the browser indicating css can be cached.

Read the rest of this update entry...
Do you need to revert your beta 1 workaround for beta 2?

This error appeared last night:
InvalidArgumentException: Must pass valid resource in src/XF/Http/ResponseStream.php:16
Stack Trace:
#0 /home/nginx/domains/ XF\Http\ResponseStream->__construct('\x1F\x8B\x08\x00\x00\x00\x00\x00\x00\x03\xED\xBD\xFD\x97\xE3...', '203642')
#1 /home/nginx/domains/ SV\RedisCache\XF\CssRenderer->wrapOutput('\x1F\x8B\x08\x00\x00\x00\x00\x00\x00\x03\xED\xBD\xFD\x97\xE3...', '203642')
#2 /home/nginx/domains/ SV\RedisCache\XF\CssRenderer->getFinalCachedOutput(Array)
#3 /home/nginx/domains/ XF\CssRenderer->render(Array)
#4 /home/nginx/domains/ XF\CssWriter->run(Array, 1, 1)
#5 /home/nginx/domains/ SV\RedisCache\XF\CssWriter->run(Array, 1, 1)
#6 {main}
Request State:
array(4) {
  ["url"] => string(125) "/css.php?css=public%3Anormalize.css%2Cpublic%3Acore.less%2Cpublic%3Aapp.less%2Cpublic%3Afont_awesome.css&s=1&l=1&d=1505233583"
  ["referrer"] => bool(false)
  ["_GET"] => array(4) {
    ["css"] => string(77) "public:normalize.css,public:core.less,public:app.less,public:font_awesome.css"
    ["s"] => string(1) "1"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1505233583"
  ["_POST"] => array(0) {

On a secondary note, would you consider adding support for IGBinary serialisation if it's available on the system?

  • Like
Reactions: Xon
Xon updated Redis Cache By Xon with a new update entry:

2.0.4 - Maintenance update

  • Major update to redis library fixing a number of inconsistencies between pure php & php-extension modes.
    • This is not a breaking change for my redis add-ons.
    • All unit tests should pass
    • For custom code, the following redis commands have breaking changes:
      • pipeline/multi/exec fixes
        • Impacts; hmget/hgetall/info/ttl/scan/sscan/hscan/zscan/zrangebyscore/zrevrangebyscore/zrange/zrevrange
      • zrange/zrevrange in php extension mode now works...

Read the rest of this update entry...
Top Bottom