We never got to the bottom of what was happening then...but my current client has this same issue. They do a LOT of dynamic removing and adding components to a single page app using PrimeFaces.current().ajax().update() as well as dynamically constructing components in Java. its a HUGE project.
Here you can see duplicates in the head like InputNumber and FileUpload. If I close one of their panels and open it again it will add 2 more copies.
I shortened it for brevity but in javax.faces.Resource update the scripts are there again.
I have no idea quite how to reproduce it but I am seeing it in their code base same as that user from 2022. They are not using a Custom HeadRenderer or anything.
Expected behavior
No duplicate CSS or JS even if the head is sent duplicate scripts.
I am still investigating this but I think it might be this Mojarra bug long since fixed that caused it to keep adding resources to the page that have already been added
Describe the bug
@tandraschko this was originally reported on a forum post in 2022: https://forum.primefaces.org/viewtopic.php?t=71210
We never got to the bottom of what was happening then...but my current client has this same issue. They do a LOT of dynamic removing and adding components to a single page app using
PrimeFaces.current().ajax().update()
as well as dynamically constructing components in Java. its a HUGE project.Here you can see duplicates in the head like
InputNumber
andFileUpload
. If I close one of their panels and open it again it will add 2 more copies.I shortened it for brevity but in
javax.faces.Resource
update the scripts are there again.Our
core.ajax
for those just automatically appends to thehead
without checking for existing CSS or JS already loaded.And thus over time our head is filling with more and more scripts and is part of their overall browser slowdown after using the app for an hour...
Reproducer
I have no idea quite how to reproduce it but I am seeing it in their code base same as that user from 2022. They are not using a Custom HeadRenderer or anything.
Expected behavior
No duplicate CSS or JS even if the head is sent duplicate scripts.
PrimeFaces edition
Community
PrimeFaces version
13.0.0
Theme
California
JSF implementation
Mojarra
JSF version
2.3
Java version
11
Browser(s)
No response