Problem with cache

Since I update to cakephp 3.7 and 3.8 I am having problems with the cache not getting refreshed. Have there been some updates about settings for cache that I am not aware of. That cause everything to not work properly?

Including debugkit is also not working when I switch to debug true, I always need to delete cache manually for it to show up properly. Then turn it to false, and back to true, it is in the right corner again a small box, with an error missing controller. Every time I need to manually delete cache. This only start after update from 3.6 to 3.7. I saw in the manual that somethings have changed about the cache system, This probably causing all the problems now…

I’m also having cache issues, but on 4.0. I was previously on 3.6 with no issues. My pages will spontaneously and intermittently fail to load with the error

Cake\Routing\RouteCollection::parseRequest(): The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Cake\Routing\Route\DynamicPageRoute" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

File $PATH_TO_APP/vendor/cakephp/cakephp/src/Routing/RouteCollection.php

Line 199 

Or with

The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Cake\Routing\Route\DynamicPageRoute" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition

File $PATH_TO_APP/vendor/cakephp/cakephp/src/Error/Debugger.php

Line 606

I’ve spent around ten hours screwing with this, hitting new errors over and over, discovering the documentation is incorrect and the api guide linked from the home page doesn’t even exist, and finally getting bitten by the totally unpredictable cache issue, and come to the conclusion that I shouldn’t have upgraded.

The forum is pretty much dead anyway

Do you have a class

Cake\Routing\Route\DynamicPageRoute

somewhere? Can’t find any reference to it in CakePHP.

Yes, that’s my custom route.

I can “fix” the issue for now by throwing a Cache::disable() at the bottom of bootstrap.php, or by disabling my custom route. Neither of these is a real solution, so I’m back to scouring the net for resources and trying to figure out what’s going on.

You have a class in the Cake namespace? That shouldn’t ever happen. Your code should all be in your own namespace (App, by default).

Well you could post code here for people to look at. But best guess so far is a messed up class namespaces/loading setup within your code. There probably isn’t a cache issue, it just happens to be the cache that trips over it.