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

Multiply assets injection #2932

Open
ink-ru opened this issue Jan 4, 2025 · 1 comment
Open

Multiply assets injection #2932

ink-ru opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels

Comments

@ink-ru
Copy link

ink-ru commented Jan 4, 2025

Description
Assets (js, css) included over "resource" with etag (to prevent caching) config param appear in code tree times

To Reproduce
Steps to reproduce the behavior:

  1. Put some links to /config/platform.php with unique names (reproduced with assets in public folder)
  2. Open any page (found on login page) and open development console (F12 for chrome)
  3. On Elements tab press Ctrl+F and type name of your asset to find them in code

Expected behavior
Assets have to be included only once

Desktop (please complete the following information):

  • OS: Cross
  • Browser: Cross

Server (please complete the following information):

  • Platfrom Version: "orchid/platform": "^14.15"
  • PHP Version: 8.1.2

Additional context
Code of etag generation:

'/css/style.css?etag='.md5(time()),

@ink-ru
Copy link
Author

ink-ru commented Jan 4, 2025

If we replace Etag to this code:

md5(floor(time()/60)*60)

problem solves

Of cause this is not a bug of Orchid, but maybe in future versions assets check feature may be added. E.g. "include_once" )

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

No branches or pull requests

2 participants