I keep having an issue where pages I’ve been working on and have been working fine suddenly can’t be found and return 404. Doesn’t matter if I’m logged in or not. Clearing the cache gets them to show up again. I’m using XRouting to map contexts to different paths. When it happens, all resources in the context return 404. Many other contexts will experience the issue at the same time but often there will be at least one context that seems unaffected.
Any ideas what could cause behavior like this?
Environment
MODX 3.1.2, XRouting 1.4.1, MODX Cloud
It could be a problem with regenerating the context information in the cache, when the cache is cleared (after a change in the manager).
In the cache folder core/cache/context_settings/<context_name> there is a file context.cache.php that contains all the information for the context in question.
The file contains an aliasMap (in this format)
'aliasMap' =>
array (
'somepage.html' => 2,
'someparent/' => 3,
'someparent/somechild.html' => 7,
...
),
that is used to determine the resource-ID from the request-URL (when a page is requested).
It could be, that this part of the file doesn’t get correctly regenerated.
Maybe the next time the issue occurs, take a look at all the context.cache.php files (of the affected contexts) and check if the data in the aliasMap array is correct.
I’ll give that a look-see next time it happens. Thanks!