When I use javascript:alert(document.lastModified) alert appears, but no information enclosed

3k Views Asked by At

When I use the following, javascript:alert(document.lastModified), in Chrome to check whether my site was updated, the alert dialog box appears, but there is no content within the box. My page is powered by PHP, therefore it should display the time and date of page request should it not?

1

There are 1 best solutions below

4
On

PHP-generated pages don't have last-modified dates. They're dynamically generated, so by definition their last-modified data is "now", regardless of how much dynamic data is actually served, or if the output hasn't changed since the last time. You'd have to set a last-modified header yourself, using header().