redis-cache is working wonders! untill I visit the page again

[ad_1]

After I installed and set up redis I checked a page of my website using gtmetrix.com and the TTFB was reduced to almost half, I was really impressed. But if I test the same page again, it goes back to what it was before redis cache was setup. If I restart the services (redis-server phpfpm nginx) and then test the page immediately ,the ttf sometimes goes down again, until I retest and it goes up again.

The website I am testing on has little to no traffic so i am pretty sure that gtmetrix is the first one visiting the website after I restart the services.

The only things I have changed in config file of redis are:
maxmemory 256mb
maxmemory-policy allkeys-lru

and in wp-config.php
define( ‘WP_REDIS_DATABASE’, 1);
define(‘WP_CACHE_KEY_SALT’, ‘mywebsite.com’);
define(‘WP_CACHE’, true);
I don’t know why this is happening and would really appreciate some help.
Thanks

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer