On the issue of data transmission in public parts such as the website sidebar footer

  node.js, question

When using Node to write a website, you need tosidebar,footerSuch as public parts as separate files, used in other pagesincludeForm loading. Then how to transfer the data to these templates when other pages are loaded is more convenient. Do you need to query every page? Is there a simpler plan?

Since it is a public part, it must only be requested once. I know that the include loading template file of angularjs is loaded asynchronously by xhr, and it is cached directly in the browser. next time you use it, it will be ok. the express framework of nodejs is the same principle. personally, you can solve this problem in the same way.