Why may my answer server be serving old static files?

Viewed 30

I am new to golang embed, but I am trying to use the answer platform to set-up a customized forum for an open source platform for my company.

I modified the code in the ui directory which is reflected in the respective build directory (./ui/build). However upon requesting the server, it serves old chunks not currently present in ./ui/build.

My assumption is that the files are being cached somewhere in the go pipeline, but even after several go clean ./... into go generate ./... and go build ./... it seems to still pull the old file paths (and somehow the files).

If it helps, I am on Windows 11 and running the server locally (not in docker atm).

1 Answers

After modifying the ui code, you must compile it before building the binary.

$ make ui
$ make build

If you don't have the make command, you can try executing the corresponding command directly.

Of course, I'd also like to know exactly what part of the ui code you changed. Whether it was due to the change itself.

There is also the case of how you are looking at the ui to see if it has changed, if it's in the form of looking at the source code, you may not see the change because the view is of the SEO page. If it's selecting elements maybe you can see the changes.

A note about go embed. As long as there are changes in the ui build folder. There will always be changes after running go build.

Powered by Answer - the open-source software that powers Q&A communities.
Made with love © 2024 Apache Answer Meta.