Don't register assets for anonymous users #15
-
First, thanks for the work on this plugin, I really love it! Currently the palette JavaScript asset is loaded on the frontend regardless of whether the visitor is authenticated or not. It should only show for users who are logged in AND have access to the control panel. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Thanks for the feedback, @Mosnar! Unfortunately, the only way to make Palette compatible on statically cached content is to use JS to make a call to Craft to see if you're authenticated. Otherwise, an authenticated user could hit the site, generate a static cache, and then an unauthenticated user would get that same experience. We try to keep the initial JS payload lean and mean (around 500 bytes) to ensure it doesn't present any performance issues. |
Beta Was this translation helpful? Give feedback.
Thanks for the feedback, @Mosnar! Unfortunately, the only way to make Palette compatible on statically cached content is to use JS to make a call to Craft to see if you're authenticated. Otherwise, an authenticated user could hit the site, generate a static cache, and then an unauthenticated user would get that same experience.
We try to keep the initial JS payload lean and mean (around 500 bytes) to ensure it doesn't present any performance issues.