XF 2.1 Guest page caching

Nirjonadda

Well-known member
I am getting error with Guest page caching. Issue with this code. Please can you let me know that how can fix this problem?

Code:
// START Guest page caching //
//$config['pageCache']['enabled'] = true;
//$config['cache']['context']['page']['provider'] = 'Redis';
//$config['cache']['context']['page']['config'] = ['127.0.0.1'];
// END Guest page caching //

Server error log:

Code:
RedisException: php_network_getaddresses: getaddrinfo failed: Name or service not known src/XF/CacheFactory.php:226

Generated by: Unknown account Nov 13, 2019 at 9:43 PM

Stack trace

#0 src/XF/CacheFactory.php(226): Redis->connect('', 6379, G)
#1 src/XF/CacheFactory.php(79): XF\CacheFactory->createRedisCache(Array)
#2 src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('Redis', Array)
#3 src/XF/App.php(639): XF\CacheFactory->create('Redis', Array)
#4 src/XF/Container.php(228): XF\App->XF\{closure}('page', Array, Object(XF\Container))
#5 src/XF/App.php(2346): XF\Container->create('cache', 'page')
#6 src/XF/Pub/App.php(54): XF\App->cache('page', false)
#7 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#8 src/XF/Pub/App.php(674): XF\Container->offsetGet('pageCache')
#9 src/XF/Pub/App.php(102): XF\Pub\App->pageCache()
#10 src/XF/App.php(2180): XF\Pub\App->start(true)
#11 src/XF.php(391): XF\App->run()
#12 index.php(20): XF::runApp('XF\\Pub\\App')
#13 {main}

-------------

Previous ErrorException: [E_WARNING] Redis::connect(): php_network_getaddresses: getaddrinfo failed: Name or service not known - src/XF/CacheFactory.php:226
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] Red...', '/home/nadda/pub...', 226, Array)
#1 src/XF/CacheFactory.php(226): Redis->connect('', 6379, G)
#2 src/XF/CacheFactory.php(79): XF\CacheFactory->createRedisCache(Array)
#3 src/XF/CacheFactory.php(34): XF\CacheFactory->instantiate('Redis', Array)
#4 src/XF/App.php(639): XF\CacheFactory->create('Redis', Array)
#5 src/XF/Container.php(228): XF\App->XF\{closure}('page', Array, Object(XF\Container))
#6 src/XF/App.php(2346): XF\Container->create('cache', 'page')
#7 src/XF/Pub/App.php(54): XF\App->cache('page', false)
#8 src/XF/Container.php(28): XF\Pub\App->XF\Pub\{closure}(Object(XF\Container))
#9 src/XF/Pub/App.php(674): XF\Container->offsetGet('pageCache')
#10 src/XF/Pub/App.php(102): XF\Pub\App->pageCache()
#11 src/XF/App.php(2180): XF\Pub\App->start(true)
#12 src/XF.php(391): XF\App->run()
#13 index.php(20): XF::runApp('XF\\Pub\\App')
#14 {main}

Request state

array(4) {
  ["url"] => string(34) "/index.php?forums/65/create-thread"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["forums/65/create-thread"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}
 
Hi guys.

I have read this thread and the other thread discussing the problem with logging out when page cache is enabled and I'm surprised of the official response because it is not one user having the problem but more (including me).
Most of us are exprerienced site owners/developers otherwise we wouldn't be posting in these technical forums and I would expect that we are taken more seriously when reporting strange errors. An error doesn't have to be present to everyone to be considered as such.
Being a developer myself, when I deliver a custom project I'm sure I have checked everything and have done all necessary testings. This is normal. You do not deliver something not working and sometimes you believe that it is the customer's environment that is causing erros. Well this may be true but the customer cannot have the same environment with you so I think that when a problem occurs (especially for more than one customers) then it is your obligation to try to fix ot by asking access to that environment. If it was my software this is what I would do.

Kind Regards
 
I would like to add to the above that not all people bother to edit the config file and make page cache work (some may not want it at all after all).

So we may not be only 5-6 people posting in this forum that are having this problem but many many more that do not know about it.
 
I honestly don't have idea even where to start looking to fix it. If more experienced people are unable, then I also can't. May be we can all collect info about our servers and software on the server. How about the addons we are running?

Mine are :

Keyword Management (KWM2) 1.5.1
Pickem 2.0.3
Sportsbook 2.0.3
 
I can rule that out, it is not caused by an add-on!
This is what I just tried:
  • Clean install XF (latest version)
  • Tried page cache using Redis > problem with logout
  • Tried page cache using Filesystem > problem with logout
  • Disabled page cache > logout is working fine
Maybe we should share our setup and look for similarities:

Code:
PHP version    7.4.0
MySQL version    10.1.43 (10.1.43-MariaDB-cll-lve)
PHP post_max_size    32M
PHP upload_max_filesize    32M
PHP max_input_vars    1000
PHP max_execution_time    30
cURL version    7.62.0
SSL version    OpenSSL/1.0.2k
Suhosin enabled    No
Imagick support    Yes
EXIF support    Yes
GZip support    Yes
mbstring support    Yes
gmp support    Yes
ZipArchive support    Yes

ps: I also submitted a support ticket about this.
 
Last edited:
Code:
PHP version    7.3.11
MySQL version    5.5.62 (5.5.62-cll)
PHP post_max_size    20M
PHP upload_max_filesize    20M
PHP max_input_vars    5000
PHP max_execution_time    30
cURL version    7.66.0
SSL version    OpenSSL/1.0.2t
Suhosin enabled    No
Imagick support    Yes
EXIF support    Yes
GZip support    Yes
mbstring support    Yes
gmp support    Yes
ZipArchive support    Yes
 
Top Bottom