Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cache issues after updates #860

Open
2 tasks done
rkg-mm opened this issue May 9, 2024 · 0 comments
Open
2 tasks done

Fix cache issues after updates #860

rkg-mm opened this issue May 9, 2024 · 0 comments
Labels
defect Something isn't working good first issue Good for newcomers p3 Nice-to-have features size/S Small effort

Comments

@rkg-mm
Copy link
Contributor

rkg-mm commented May 9, 2024

Current Behavior

After Dtrack server updates, users regularly report a broken UI. I've seen it myself, in slack as well as requests from my collegues.
Even though the JS/CSS files seem to have mechanisms to enforce refreshed loading after updates due to changes in the numbers of the files (which should be double checked), the issue is that the HTML files are cached themselves, thus serving old HTML content and therefore pointing to outdated JS/CSS files, too.

Ideally, caching should be disabled for HTML files (following headers), and only be enabled for other file types.

Cache-Control: max-age=0, no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0

(see also https://fred-gu.medium.com/fix-the-annoying-web-page-caching-issue-permanently-5d16527d0b5a)

Furthermore I see a risk in caching /config.json, which might lead to unexpected results after some config changes. This possibly should also not be cached.

Steps to Reproduce

  1. Open UI in browser. If using Dev tools, ensure "disable caching" is not enabled.
  2. Update from 4.10 to 4.11
  3. Open UI in browser again without hitting F5 (which sometimes avoids cache)
  4. With a high chance you end up with a broken UI in some places

Expected Behavior

After an update the HTML page should not be loaded from cache enforcing an update of all other files as well, and the UI should not be broken.

It should be double checked if the JS/CSS files are enforced to reload after HTML updates as I expect it due to the attached chunk numbers.

/config.json should be considered to be excluded from cache, too.

Dependency-Track Frontend Version

4.10.x

Browser

Google Chrome

Browser Version

No response

Operating System

Windows

Checklist

@rkg-mm rkg-mm added defect Something isn't working in triage labels May 9, 2024
@nscuro nscuro added p3 Nice-to-have features good first issue Good for newcomers size/S Small effort and removed in triage labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working good first issue Good for newcomers p3 Nice-to-have features size/S Small effort
Projects
None yet
Development

No branches or pull requests

2 participants