On load .lit
determines the src
and root
and checks both local file system (testing/LightningFS) and the remote host (ie GitHub pages, or local/remote server) and compares last-updated
(or Stat mtimeMs
in the case of local filesystem)
The problem is, that deployment to GitHub pages results in a remote file that seems newer than the local file that created it.
Potential solutions
- Disable (appropriately) GitHub Pages cache testing/log/2021-06-10
- Read from api instead of pages static file server when Authenticated
- Potentially read and write to
gh-pages
directly, eschewing Actions deployment entirely. - Currently reading and writing to GitHub api when token is available. Breaks reading generated files like : manifest.json
- Potentially read and write to
- Compare hashes of the content stackoverflow crypto↗
- store creation and modified date in frontmatter
return lit.fs.readFile('/manifest.json')
return JSON.stringify(lit.utils.diff.diffLines(lit.stats.local.value, lit.stats.remote.value, {
newlineIsToken: true,
}), null, 2)