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
Enable authors to specify SXG-only tags #87
Comments
and/or we could have a simpler API for the common use case. Something like: <meta name=declare-sxg-var> becomes something like: <script>window.isSXG = true</script> |
On further thought, we should definitely at least do the first one (probably both). And it should delete the template tag on non-SXG. This covers another use case: being able to include JS & templates (they can be nested) for lazy-loading personalized elements, without affecting the byte size of the non-SXG version (which can personalize via dynamic HTML instead). |
Remaining task is to implement on fastly_compute. |
Implementing for fastly_compute should be easy now that process_html.rs exists. |
For instance if the HTML contains:
then when generating an SXG, rewrite it to:
Other possible spellings include
<template class=sxg-only>
or<script type=text/sxg-only>
or<!--[if SXG]>
, but the above seems the most general and least likely to collide with existing pages. (But that should be confirmed before implementing.)Motivation
Enable web publishers to distinguish SXG visits from unsigned visits in their analytics. This could help them track overall usage, or compare performance metrics between the two cohorts. Examples of feature requests for a similar tool (CF ASX):
The text was updated successfully, but these errors were encountered: