I am running the server in docker on vagrant on windows and plan to deploy in docker on linux (ubuntu)
But I have been having a lot of trouble with cacheing if I use the hugo server or browser differences if I use the nginx server
with the hugo server - watch update the files in public if I change them in linux, but it doesn’t if I change it in windows even though the are shared through a docker volume
even after the files are updated in public the content on the website does not change unless I restart the server - auto refresh seems to happen but the content doesn’t actually change
if I run hugo watch and than serve the content using nginx - I get updated files but the nginx seems to not render correctly on firefox or chrome - only works on ie. Also the auto refresh doesn’t work
The point isn’t to run the Hugo server in production. You would generate the static files and deploy them to be served by nginx. At that point, any caching issues are solely nginx issues, since Hugo finished its job prior to deployment.
i was running hugo serve --watch --theme=hyde --buildDrafts --verbose
but now I am just running hugo --watch --theme=hyde --buildDrafts --verbose
and seperately running nginx - i had to add a mim.types file and included that in my conf file and than clear the cached files from chrome - now everything is fine except the auto refresh
I am going to see if this also fixed the issues using the hugo server because tehe auto refresh is really cool
@Anthony_Louis_Burns we are working on improving Hugo’s behavior on Windows. Would you please file an issue about Hugo not detecting changes made on Windows?
I have experienced some cache refresh issues like you describe. Clearing out the public folder, while not ideal, resolves that. There is an issue https://github.com/spf13/hugo/issues/379 related to this.
There are also requests to add cache-busting to Hugo.
Contributions of all kinds, including issue reports are welcome and appreciated.
@Anthony_Louis_Burns I’m writing this on a Linux PC, but have installed Hugo dev environment in Windows on a second one and I’m looking into a set of Windows related issues, including one that matches yours.
Hang in there - and you will be rewarded in the long run. Hugo is worth it.
Much appreciated - it seems like exactly what I am looking for
Totally new to go though - so its hard for me to tell exactly what is happening when I get unexpected behaviour
Contains fixes to your troubles. I have tested the livereloading on Windows, both for content and static files, and it should work fine after/if that PR gets merged into master.
Well, if you are impatient or want to help test this out - you could just build from my branch. That branch will not get any new updates, but is up-to-date as of today.
Depending on how you have set up your environment, I’m not sure whats easiest, add my repo as a remote (git remote add bjornerik git@github.com:bjornerik/hugo.git) or do a full “clone git@github.com:bjornerik/hugo.git” then check out the windows-fixes branch and build that.