Use javascript code to determine whether a web page is static or pseudo static

  • 2020-03-30 02:48:15
  • OfStack

Recently I have been studying Dedecms. Before I was ready to build the site, I had been thinking about whether to use pseudo-static or not. Until now, I have not decided. So we open a website, in the case of insufficient basic knowledge, how to quickly and easily determine the page is static or pseudo-static? Here is a brief introduction:

Pseudo-static and static single from the URL, it is difficult to tell, the general web suffixes are.html at the end. We can use a simple piece of javascript code to determine:

This javascript code can only be opened in IE and cannot be tested in Chrome or Firefox

When we open the target page, enter javascript:alert(document.lastmodified) in the address bar to see the last update time of the page:

If the page is static, the date time is different from the system time on our computer.

If the web page is pseudo-static, the date time is exactly the same as the system time of our computer, accurate to the second.

In my home page to do a test, after opening with my current computer system time is completely consistent, can simply judge for the web page is pseudo-static.

Related articles: