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

[Bug]: NGINX serves stale production assets in dev mode #15325

Open
1 task done
KevinMind opened this issue Jan 31, 2025 · 1 comment
Open
1 task done

[Bug]: NGINX serves stale production assets in dev mode #15325

KevinMind opened this issue Jan 31, 2025 · 1 comment
Labels

Comments

@KevinMind
Copy link
Contributor

KevinMind commented Jan 31, 2025

What happened?

Here be dragons.. jk but this is tricky.

If you run make up in dev mode, and previously had a compressed production asset from a previous commit, the bundled asset will take precedence in nginx file serving and you can have a broken FE.

  1. create a file test.txt in ./static add "foo" to the file
  2. run make up DOCKER_TARGET=production
  3. Expect that the file is copied to ./site-static
  4. Change the contents of the file "banana"
  5. Run make down && make up DOCKER_TARGET=development
  6. request the file from http://olympia.test/static/test.txt
  7. BUG: the file will have "foo"

What did you expect to happen?

The file should return "bar" in dev mode because we should not be serving/prioritizing production assets in dev as in dev we are not managing those files. They will not be updated or removed because this takes time and slows down make up.

So in order to prevent errors, we need to ensure that in dev mode nginx does not try to serve production assets.

Is there an existing issue for this?

  • I have searched the existing issues

┆Issue is synchronized with this Jira Task

@KevinMind
Copy link
Contributor Author

@diox FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant