Skip to content

Prevent needing to disable HTTP Cache during development #1740

@anoadragon453

Description

@anoadragon453

The browser's cache unfortunately makes development difficult as it needs to be disabled, and the browser's developer tools kept open. One small trick that can be done is append a version number to the file's import to force a refresh. For example:

<script src="my/script.js?v=1.1"></script>

However updating this version number every time an edit is made is arguably even more work for site developers... unless we could automate this behavior.

If, on page load, ZeroNet would append an auto-incrementing number to each imported resource (CSS, JS) such the unix timestamp, this problem would be solved.

Would it be possible for ZeroNet to do this processing to HTML files before serving them to the browser?

As more motivation I had a friend starting ZeroNet development today and he got stuck and confused after his site wasn't updating when he changed it. Took him an hour of frustration to eventually contact me and I told him about the cache. I know it's on our docs, but people don't always check or read that far :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions