Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browsers cache images too long #143

Open
nopara73 opened this issue Feb 1, 2025 · 1 comment
Open

Browsers cache images too long #143

nopara73 opened this issue Feb 1, 2025 · 1 comment

Comments

@nopara73
Copy link
Owner

nopara73 commented Feb 1, 2025

If image is updated the browser doesn't show that

@nopara73
Copy link
Owner Author

nopara73 commented Feb 3, 2025

If I add the version stuff the cache will reset:

<script src="/js/pheno-age.js?v=1.1"></script>

But maybe I could reset cache every week:

<script>
    var date = new Date();
    var year = date.getFullYear();
    var week = Math.ceil(((date - new Date(year, 0, 1)) / 86400000 + new Date(year, 0, 1).getDay() + 1) / 7);
    var script = document.createElement('script');
    script.src = '/js/pheno-age.js?v=' + year + '-' + week;
    document.head.appendChild(script);
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant