I am looking for loading mustache templates remotely, for example
<script type="text/plain" template="amp-mustache" src="https://domain.com/endpoint">
This will help us to reduce the HTML size and will enhance our dynamic content experience.
I don't think we currently have plans to support this. @omar-a-toma could you tell us a bit more about the use cases that you are using this for? Templates really should not be so large that they need to be loaded from a separate endpoint.
So far templates had to be static to be validated with the same rules as the rest of AMP markup. With amp-script
duplicating a lot of our validation rules in the runtime sanitizer, this might now be doable if we decide to.
@cathyxz So we are using AMP in our price-aggregator website https://iprice.my, we are using amp-list in multiple places and most of them are not shown unless the user triggered them with an action. cutting out those templates will help to reduce the HTML size also it can help us to provide a personalized user experience
I see. So there is a rather valid use case for this. I'll defer to @nainar as to whether and when we'd like to scope this for implementation.
I think that is definitely something to consider and scope highly for amp-list. I am sure there are security issues that we will have to consider here.
Paging @choumx
In some cases, the templates are very long & somehow heavy. If we could load it remotely, that would speed up the site load a lot.
I don't see why this is desirable yet. Can you share a concrete use case e.g. URL to a live AMP page?
@choumx we are using multiple templates in our website here for example iprice.my
Most helpful comment
I think that is definitely something to consider and scope highly for amp-list. I am sure there are security issues that we will have to consider here.
Paging @choumx