feat(FOUR-32025): Review performance: DB access and queries in login can be cached into redis, images#8931
feat(FOUR-32025): Review performance: DB access and queries in login can be cached into redis, images#8931rodriquelca wants to merge 5 commits into
Conversation
…can be cached into redis, images
|
QA server K8S was successfully deployed https://ci-a186b80932.engk8s.processmaker.net |
There was a problem hiding this comment.
Code Review — feature/FOUR-32025_B vs develop
Verdict: Do not merge — 2 blockers.
1. defer breaks ProcessMaker.packages init order
Deferred bundles run after the sync inline that sets packages. Then app-login.js reassigns window.ProcessMaker and resets packages to [].
<script src="{{ mix('builds/login/js/manifest.js') }}" defer></script>
<script src="{{ mix('builds/login/js/vendor.js') }}" defer></script>
<script src="{{ mix('builds/login/js/app-login.js') }}" defer></script><script>
window.ProcessMaker = window.ProcessMaker || {};
window.ProcessMaker.packages = @json(\App::make(ProcessMaker\Managers\PackageManager::class)->listPackages());
</script>
<script src="{{ mix('js/translations/index.js') }}" defer></script>window.ProcessMaker = {
i18n: i18next,
/**
* A general use global event bus that can be used
*/
EventBus: new Vue(),
packages: [],Expected order (pre-change): app-login.js → set packages.
Actual order (with defer): set packages → app-login.js overwrites → packages = [].
Fix: keep packages assignment after app-login execution (remove defer, or set packages after boot / merge instead of replace).
2. Login caches never invalidated on branding update
<link rel="icon" href="{{ cache()->remember('login.favicon', 3600, function () { return \ProcessMaker\Models\Setting::getFavicon(); }) }}"> <div class="footer">{!! cache()->remember('login.footer_html', 3600, function () use ($loginFooterSetting) { return $loginFooterSetting->config['html']; }) !!}</div>Invalidation still only clears the old keys:
if ($request->has('fileFavicon') && $request->input('fileFavicon') !== 'null') {
$this->uploadFile($setting->refresh(), $request, 'fileFavicon', Setting::COLLECTION_CSS_FAVICON, Setting::DISK_CSS);
Cache::forget('css-favicon');
}
// Custom Login Logo
if ($request->has('fileLogin') && $request->input('fileLogin') !== 'null') {
$this->uploadFile($setting->refresh(), $request, 'fileLogin', Setting::COLLECTION_CSS_LOGIN, Setting::DISK_CSS);
Cache::forget('css-login');
}Footer update also never forgets login.footer_html:
private function setLoginFooter(Request $request)
{
$footerContent = $request->input('loginFooter', '');
// ...
Setting::updateOrCreate([
'key' => 'login-footer',
], [
'config' => ['html' => $footerContent],
]);
}Impact: favicon/footer can stay stale for up to 3600s after admin update.
Fix: Cache::forget('login.favicon') / Cache::forget('login.footer_html') on CSS override + footer save (or drop these Blade caches and rely on existing Setting/media cache-bust).
@gproly CR notes was fixed |
|
|
QA server K8S was successfully deployed https://ci-a186b80932.engk8s.processmaker.net |





Issue & Reproduction Steps
Describe the issue this ticket solves and describe how to reproduce the issue (please attach any fixtures used to reproduce the issue).
Solution
perf.mov
How to Test
Related Tickets & Packages
Code Review Checklist
ci:deploy