Bug Full Guest Cache Does Not Work as Intended?

Status
Not open for further replies.

semprot

Customer
Hi.

When monitoring my memcached cached objects, i noticed that memcached cache is cleared often.
No server error, still lot of available memory.

Memcached : 1.4.34
PHP memcache : 3.0.9-dev
PHP version : 7.0

UPDATE : After observing further, i noticed this happens only if i chose memcached, and did not happen when i chose redis

So to make a test, i set "Full Guest Cache" to 3600 (1 hour).
All other caching options are disabled.

I waited for +- 10 minutes.
There were lot of new posts created during those 10 minutes.

Then i compared between logged in users and guest.
I noticed that the result between logged in & guest, are all the same.

Thank you.
 
Last edited:
I listed the operators that support partial flushing here: https://www.dragonbyte-tech.com/f42/does-file-cache-follow-ttl-21245/#post106796

Yes, that's normal, as the forum/thread/post caches all get cleared whenever a new post is created. Furthermore, the Filecache (as well as certain other cachers) do not have the ability to delete only certain cache entries when your cache needs purging ("delete by prefix").

For maximum performance, you should use Redis, as this cacher has the ability to delete by prefix. Other cachers with this capability: APCu and WinCache (Windows OS only).

Filecache should not be used as your main method of caching, unless you disable all caches other than Guest Full Page Caching and Data Registry. All other caches are updated and cleared too frequently.

In short: At the moment, only Redis, APCu and WinCache has the ability to clear only relevant bits of the cache.

In the future, I will revisit this, but at the moment I would like to recommend you use Redis for this.
 
In short: At the moment, only Redis, APCu and WinCache has the ability to clear only relevant bits of the cache.

In the future, I will revisit this, but at the moment I would like to recommend you use Redis for this.
Thank you, but i only activate Guest Full Page Caching.
Other options are off.

Does it still work as intended?
 
Currently, it does, yeah.

The way the TTL system works is that if it detects the TTL has expired, it calls the delete function for the requested cache key - this is done in order to conserve memory. However, if the cache system doesn't support partial flushing, that would end up wiping the entire cache.

I'm going to look at the way the PSR-6 cache system is implemented in other frameworks such as Symfony and Laravel and see if I can improve the implementation to support partial cache flushing for every cache type.
 
Currently, it does, yeah.

The way the TTL system works is that if it detects the TTL has expired, it calls the delete function for the requested cache key - this is done in order to conserve memory. However, if the cache system doesn't support partial flushing, that would end up wiping the entire cache.

I'm going to look at the way the PSR-6 cache system is implemented in other frameworks such as Symfony and Laravel and see if I can improve the implementation to support partial cache flushing for every cache type.

Ok i will wait for next update. I hope it will work using memcache just like the VB version :)

Using redis with high volume requests causes error in my server :(

Temporarily, i modified :
Code:
/library/DBTech/Optimise/Operator/Memcache.php

and i disabled these 2 functions.

PHP:
	protected function _delete($id)
	{
		return true;// SEMPROT MOD
		switch ($this->type)
		{
			case 'memcache':
				// Delete the value from the cache
				return (bool)$this->memcache->delete($id);
				break;

			case 'memcached':
				// Delete the value from the cache
				return (bool)$this->memcache->delete($id);
				break;
		}
	}

PHP:
	protected function _flush()
	{
		return true;// SEMPROT MOD
		// Remove the cache entries
		return (bool)@$this->memcache->flush();
	}

Everything seems to work for full guest page cache only.
Cache is not cleared often.

I create a PHP script to flush memcache cache & use cronjob to call it, just in case my memory is not enough to hold the cache / something wrong.
 
Last edited:
I have an untested implementation of _deleteByPrefix for Memcache and XCache, as well as a working implementation for Filecache.

Can you PM me with an FTP and AdminCP account so I can test the Memcache implementation on your site? There is no Memcache extension for PHP 7.1 so I am unable to test it myself.
 
I have an untested implementation of _deleteByPrefix for Memcache and XCache, as well as a working implementation for Filecache.

Can you PM me with an FTP and AdminCP account so I can test the Memcache implementation on your site? There is no Memcache extension for PHP 7.1 so I am unable to test it myself.
I use PHP 7.0, and i installed the memcache PECL using steps described here :

Installing Memcache on EasyApache 4 for PHP 7 | Duvien

I think that won't work for PHP 7.1
 
Can you please PM me with an FTP and AdminCP account so I can test the Memcache implementation on your site?
 
Update: I took the liberty of testing the Filecache operator's changes as well, and let's just say the /internal_data/dbtechOptimise directory filled quite quickly :P
I'm running cleanup just now, removing all of the files it created.

I was able to get the Memcache operator changes working as well, the cache is filling quickly :)
 
Update: I took the liberty of testing the Filecache operator's changes as well, and let's just say the /internal_data/dbtechOptimise directory filled quite quickly :P
I'm running cleanup just now, removing all of the files it created.

I was able to get the Memcache operator changes working as well, the cache is filling quickly :)
I notice all options in DB Optimise are on now.
So everything works now using memcache? :)

Thank you.
 
It should do, yeah, I think your cache had grown to about 1 GB when I closed the window last night, it wasn't getting purged every time a post was made or anything like that.
 
It should do, yeah, I think your cache had grown to about 1 GB when I closed the window last night, it wasn't getting purged every time a post was made or anything like that.
Awesome i can see lot of changes in FileCache.php and Memcache.php

So it is ready for the next DB Optimise update? :)
 
Hello semprot,

This ticket has now been closed with the status Fixed.

We hope your issue or question has been addressed to your satisfaction. If not, please feel free to re-open it by clicking this link.

If you have any further issues or questions, please feel free to start a new support ticket via the button at the top of every page.

Thank you!
 
Status
Not open for further replies.

Legacy DragonByte Optimise

XenForo 1.5.3+
Seller
DragonByte Technologies
Release date
Last update
Total downloads
258
Customer rating
0.00 star(s) 0 ratings
Top