You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using preload: link-header is great but it adds too much in the link header in my opinion.
To add only specific entries, I tried two solutions:
use different bundle configurations (a regular one, and one for addingto link header) as per the doc but it's not possible, because the preload config entry is not available as per multiple configuration (it's only available on root configuration) as per the configuration file on github lol
use RenderAssetTagEvent as per the doc . It worked, by adding a custom "i-want-that-in-link-header" attr, and in the RenderAssetTagEvent subscriber, checking for this attribute and adding the ref attribute to link header via the SF weblink component
The second solution is not that bad, but it would be nice to have another associative array of options next to attr to avoid messing with the existing and legitimates attributes.
But imo, the best solution would be to have the preload: link-header available on "sub" configurations.
Let me know what you think about it, and if you have any questions,
Hugo
Example
No response
The text was updated successfully, but these errors were encountered:
Hi @HugoImaios,
I think I would lean more towards the 2nd solution. your expectation is precise and it seems to me that the first solution provides an answer but in many cases will not be sufficient while the second would at least have the merit of providing a solution for all cases. Indeed this does not protect us from modifying existing attributes, but I do not think that this is a problem unless we wish to define headers different from the html attributes. Are there any cases where this could happen?
Indeed I'm not sure it's a problem, but I'm not very comfortable with the idea of adding an attribute "i-want-this-in-link-header" just to flag this tag and not use the attribute. (in fact, I even remove it for the tag in my RenderAssetTagEvent)
I think that the best solution we be to put it in a separate parameter called something like contextOptions, next to attr which would be clearly used only for html attributes.
Description
Hello !
Using
preload: link-header
is great but it adds too much in the link header in my opinion.To add only specific entries, I tried two solutions:
preload
config entry is not available as per multiple configuration (it's only available on root configuration) as per the configuration file on github lolRenderAssetTagEvent
as per the doc . It worked, by adding a custom "i-want-that-in-link-header" attr, and in theRenderAssetTagEvent
subscriber, checking for this attribute and adding the ref attribute to link header via the SF weblink componentThe second solution is not that bad, but it would be nice to have another associative array of options next to
attr
to avoid messing with the existing and legitimates attributes.But imo, the best solution would be to have the
preload: link-header
available on "sub" configurations.Let me know what you think about it, and if you have any questions,
Hugo
Example
No response
The text was updated successfully, but these errors were encountered: