0

I would like to exclusively have a rest backend with every other part of the site being fully static. In order to do this I need a js libarary that makes the users browser download and stitch together HTML files for content, header, sidebar, etc. Is there a libary that lets me do this? Which basicly creates a custom tag or something that lets me create sites like this:

<html>
<--!doctype-->
<include doc="header.html">
<include doc="doc1.html">
<include doc="sidebar.html">
<include doc="footer.html">
</html>

Basicly stuff thats usually done on the backend is move to the client computer for security and perfomance reasons (critical data is only acessed through rest objects).

Is there a libary that helps me realize such a design? Because I also want to be able to cache the static site content and that is a lot easier when I can just keep it on apaches static directory instead of creating django requests.

6
  • How does moving backend stuff to the client help with security or performance? Anything that goes to the client may be manipulated and depending on the users browser and computer may not help performance at all. – Dave Jan 31 '20 at 21:02
  • What about using the iframe html tag? The HTML Inline Frame element (<iframe>) represents a nested browsing context, embedding another HTML page into the current one. – knb Feb 1 '20 at 10:26
  • Good idea, ill try that – user2741831 Feb 2 '20 at 11:21
  • @Dave server side code is dangerous, client side is harmless – user2741831 Feb 3 '20 at 9:57
  • @user2741831 Not trying to start an argument but I do believe you have that backwards. The client side can do just about anything and is never to be trusted. – Dave Feb 3 '20 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.