So I9;m working on a website. This website is mostly static content. However, there will be two parts to the website:

  1. A single page on the will be heavily dynamic, pulling in information from various external sources for display.
  2. Other pages will be mostly static, but they may have a few dynamic things sprinkled-in that require pulling information from the same website locally, e.g. from the site database.

Now, I can do this easily enough for JS users, by delivering HTML+JS content to the browser, and using Ajax to load the dynamic information in the background and display it when it's ready. That's all fine. That's what I want to do.

However, that obviously won't for non-JS users. So as far as I can tell, I have basically two options:

  1. Make the entire page dynamic (e.g. .php), get the dynamic information server-side, and deliver that to the browser. My problem with this is that it means no nice, clean, static pages that can be quickly served by Nginx and cached by browsers, and also that it would probably be forced on JS users too.

  2. Deliver static HTML content as normal, with where needed which display small PHP pages. For JS users, the script would remove the and do the Ajax instead. My problem with this is that I've heard that are the devil, although this article says otherwise.

Basically, most of the site visitors use JS, and I want to create a polished, perfect experience for them. However, basic non JS support is important too. I want to keep to having static HTML pages if possible for the fast speed with Nginx + browser caching. And I want to know the best way to deal with this situation under those circumstances.

Could you guys give me some advice here please? Should I go with one of the two options I listed? Are there more options I'm not considering? Are my goals invalid in the first place for some reason? Thanks.

submitted by /u/MidnightSkyFlower
[comments]



Source link
thanks you RSS link
( https://www.reddit.com/r/webdev/comments/7xefte/_about_how_best_to_do_a__/)

LEAVE A REPLY

Please enter your comment!
Please enter your name here