Outdated URL returned after changing URL
Site URLs' are stored in two different caches:
- inside
rewrittenCache
inOutput.php
at runtime - persistent cache for URLs
The runtime cache can be cleared by calling \QUI::getRewrite()->getOutput()->removeRewrittenUrlCache($Site)
.
This does not happen automatically after changing a site's URL but it should.
The persistent cache is located at QUI\Cache\Manager::get(QUI\Projects\Site::getLinkCachePath($project, $lang, $id))
.
It's filled and queried in the Output::getSiteUrl()
method.
Once a value is stored in the cache it can not be overwritten/reset by calling another method.
You'd have to locate and empty that cache manually.
This causes errors when querying a site's url after it changed. The system then returns the old URL since it is cached.
The system should empty the runtime- and persistent-cache after the URL changes and/or the site is saved.