spanezz / staticsite

Static site generator
GNU General Public License v3.0
45 stars 7 forks source link

Preserve mtimes when building site #23

Open spanezz opened 4 years ago

spanezz commented 4 years ago

When writing rendered pages and assets to the destination directory during build, if staticsite has a mtime for the rendered content (like an assed source image mtime, or the most recent date for a page in a syndication), the resulting file mtimes could be set to match it.

This allows a web browser to handle correctly, for example, If-Modified-Since headers from webbrowser, and to more aggressively skip rewriting pages that didn't change since the last site build.

spanezz commented 4 years ago

Note that, for a syndication, the date of the syndication fits the highest date of its pages, but its mtime should be the highest mtime of its pages. For example, if a typo is corrected in a page, the syndication date should not change, but the page contents inside the syndication should get corrected.