Hard refresh is required to update webpages created using RMarkdown
Hi,
So I've a site with lots of webpages. Issue is that user refreshing one page doesn't refresh the whole site and on next page, users have to refresh again to view the latest content.
Can you suggest something for me to add a script, kind of like this https://stackoverflow.com/a/63459259 so that I won't have to edit each page and each webpage will auto refresh on user access.
Hi,
As you described, I don't think this is a R Markdown issue directly. Can you give me more details ?
So I've a site with lots of webpages.
Is this a R Markdown websites using html_document() format ? Do you use self_contained: false ?
Issue is that user refreshing one page doesn't refresh the whole site and on next page, users have to refresh again to view the latest content.
Refreshing a hosted website is a browser behavior. R Markdown will produce some HTML pages, and some resources - all to be hosted on a server to be browsed online. There is no specific caching on some sort on the R Markdown side. However, a web browser has some caching happening that could prevent a webpage to be fully updated as some resources could be cached. Usually though when a resource change or HTML page change the cache would invalidated. But again, this is a browser behavior.
Can you suggest something for me to add a script, kind of like this stackoverflow.com/a/63459259
The link you shared is about opening a link with a specific attributes. It is not related to caching. Changing an attributes is something that you can control when producing the HTML, which R Markdown does. But caching of webpage is something happening at the browser level.
If you modify your website, then the browser should see a new website an update accordingly.
I may be missing the whole point here maybe, but I am answering with the context and information you gave me. If you can provide a more detailed example, and even a reproducible example, that would really help understand how R Markdown itself can be at fault here.
If you have a website link to share, I can also give a look to the hosted website which has the issue.
Hope it helps