Website hosted locally on the server doesn't work fast without the Internet on the PC

I’m trying to serve both documentations for offline use

Both of them are hosted in the container on another server with Docker Swarm,
and both are deployed according to the guildelines by the official documentation maintainers,
But the requests from my local PC to the container running on another server take very long

So when I’m trying to make a request to the Hugo Application:
Local PC (without Internet) → Server with Docker Swarm (With Internet)
It takes over 2 minutes to render the response

And again the server that hosts this documentation HAS the Internet, only the PC doesnt
And in the container logs, there’re no error messages - only:

DEBUG 2023/08/16 12:57:59 Render page Оркестрация контейнеров промышленного уровня to "/ru/index.html"
DEBUG 2023/08/16 12:57:59 Render page Оркестрация контейнеров промышленного уровня to "/ru/feed.xml"
DEBUG 2023/08/16 12:57:59 Render page Оркестрация контейнеров промышленного уровня to "/ru/_headers"
DEBUG 2023/08/16 12:57:59 Render page Produkcyjny system zarządzania kontenerami to "/pl/index.html"
DEBUG 2023/08/16 12:57:59 Render page Produkcyjny system zarządzania kontenerami to "/pl/feed.xml"
DEBUG 2023/08/16 12:57:59 Render page Produkcyjny system zarządzania kontenerami to "/pl/_headers"
DEBUG 2023/08/16 12:57:59 Render page Довершена система оркестрації контейнерів to "/uk/index.html"
DEBUG 2023/08/16 12:57:59 Render page Довершена система оркестрації контейнерів to "/uk/feed.xml"
DEBUG 2023/08/16 12:57:59 Render page Довершена система оркестрації контейнерів to "/uk/_headers"
DEBUG 2023/08/16 12:57:59 Render XML for "sitemapindex" to "sitemap.xml"
DEBUG 2023/08/16 12:57:59 Render Robots Txt to "robots.txt"

EDIT:
I noticed that the .css take that long to load


Does it need to be downloaded on its own for the webpage to work?
Or is there an option to download .css files on the server side?

I doubt that your questions are related to Hugo in any way. The server delivered with it is, afaik, not intended to be used in production. So, you might be better off serving with nginx or Apache.

Your question re CSS makes no sense to me. The browser has to download CSS, yes. What do you mean by “on its own”? And why would “the server side” (that’s Hugo in this case) download the CSS at all? At best, it provides the CSS to the browser. But again: Hugo server is not meant to be used in production.

Sorry for the confusion,

I just don’t have ideas on how to fix this issue,

I doubt that your questions are related to Hugo in any way

I’m only encountering this issue with Hugo,
I self-host other websites with docusaurus, mdbook, mkdocs and It works without issues,

So, you might be better off serving with nginx or Apache.

Could you explain the steps to do that?

Generate a static site with Hugo, put the public directory wherever you want and run Apache/nginx there. These tools are made to serve websites. Hugo is not.
Nor is, btw, mdbook (quoting from their own website):

Note: The serve command is for testing a book’s HTML output, and is not intended to be a complete HTTP server for a website.

mkdocs isn’t providing a server. No idea what “works without an issue” means in this context.

Also: Why are you employing so many tools for the same task? Wouldn’t one be enough, if you feel comfortable with it and it “works without issues”?

Just following the guides on how to build and run documentations locally,
and If I could access the application locally then It was enough for me

I had no idea, that nginx could be that versatile and perform better
and that these tools like mdbooks are only for development purposes,
thank you :slight_smile:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.