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

our-svg caches the CSS class #58

Open
drpeck opened this issue Apr 28, 2023 · 3 comments
Open

our-svg caches the CSS class #58

drpeck opened this issue Apr 28, 2023 · 3 comments

Comments

@drpeck
Copy link
Contributor

drpeck commented Apr 28, 2023

For the same SVG I have both

<our-svg src="@Model.SiteLogo" class="foo"></our-svg>
<our-svg src="@Model.SiteLogo" class="bar"></our-svg>

With the cache turned on the class attribute is cached and 'foo' is rendered in both locations. I suggest adding the CssClass to the cache key is the simplest workaround. The ideal solution would presumably be to cache the file content rather than the HTML output.

@warrenbuckley
Copy link
Member

@drpeck do you fancy trying to solve this problem and submit a PR and update the unit tests for this scenario ?

@drpeck
Copy link
Contributor Author

drpeck commented May 16, 2023

Is the preferred approach to add the class to the cache key? That will resolve this issue, but I suspect that the issue may exist for all attributes (e.g. <our-svg src="@Model.SiteLogo" id="logo"></our-svg>). Ideally the file contents would be cached and the rendering of the tag would not be, but that looks like a much bigger change.

@warrenbuckley
Copy link
Member

Happy to any solutions or ideas you have for this @drpeck

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

No branches or pull requests

2 participants