1

Say I am wanting to include a third party HTML component in my site...

I know that I can simply include a <script> tag to pull in the component on the client's side; however because I do not trust this component to load in a speedily manner, or to load at all, I am wanting to have it server side render for users so that I am not left with egg on my face when it inevitably fails to load due to some connection issue to the host.

This would be simple if the component was in a final state and would be static, however I know that there is a strong possibility for updates to be rolled out to this component in time, which would leave any static version on my server out of date etc. A problem that would easily be avoided if I'd just use the <script> tag mentioned earlier.

My question is... How do I get around this? Should I be polling the link in the <script> tag I have been given once a day for example just to ensure I have the current version? Should I attempt some sort of subscription service to the link?

1 Answer 1

1

A component that's activated by a script tag will be written in javascript and designed to run in a browser. It will typically work by modifying the DOM, which is how the browser manages the content displayed to the user.

A component that runs server-side will target a server-side runtime, for example PHP or ASP.NET Razor. It will emit html which is then send to the client browser to be displayed.

The two are not easily interchangeable.

If you are worried just about the hosting of the script, the easiest solution is to host a copy of it with your other content. This way you can lock down a version and also ensure it's availability.

1
  • Yeah I understand that. I also thought of perhaps seeing if they were up for updating via ssh etc.
    – physicsboy
    Commented Feb 21, 2020 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.