Relative paths on URLs make the build time insanely long

Here’s my repo and the live site. Up until recently the build time in Github (and locally) was about 3 minutes. This is expected because the site has ~16000 pages.

A few days ago I added som 60 pages with tables generated in markdown format. The tables contain many relative URLs of the form:

entry = [entry_name](/_clusters/name/)

which end up pointing, for example, to https://ucc.ar/_clusters/ngc2516/.

Immediately I noticed that the build time jumped to almost 50 minutes, which can be seen for the builds of last week and 3 days ago in the Github Actions page.

After some testing I realized that it was indeed those relative paths that were the problem. If I instead use an absolute path like:

entry = [entry_name](https://ucc.ar/_clusters/name/)

then the build time drops to 6 minutes, which is far more reasonable.

My questions:

  1. Is this expected?
  2. If so, why?
  3. Is there any way to prevent this insane build times other than using absolute paths?

hmmm, ChatGPT thinks it knows the answer but I am not sure about it - but I don’t know what jekyll is doing behind the scenes.

Here is part of my chat:


Why Relative Paths are Expensive
Large Site with Many Links:

On a site with 16,000+ pages, each page may have multiple relative links.
Jekyll processes each link by calculating its resolved path, which grows exponentially as the number of interlinked files increases.

Rebuild Cascade:

Every time Jekyll resolves a path, it checks if the referenced file changes, which can cascade if dependencies span thousands of pages.
Markdown Tables:

If a table contains many relative links, Jekyll handles each link separately during Markdown parsing and path resolution, compounding the cost.
Why Absolute Paths Help
When you switch to absolute URLs like:

[entry](https://ucc.ar/_clusters/name/)
No resolution required: Jekyll treats absolute URLs as external resources.
It doesn’t need to calculate or adjust them, significantly reducing dependency tracking and overall processing time.


I’m a little skeptical that jekyll is resolving the path on each link, but chatgpt is fairly sure it is. Its also supported by your experience pretty well. It is worth trying it on your own if you have access to an AI - it gave a lot of info and seemed pretty sure this is the issue.

I would have thought the relative url was just text and not being interpreted in any way - if you look at a rendered relative url made in that fashion is it still a relative url? or after it is rendered is it an absolute url?

On my local machine I did the following:

I tried putting the two versions of UCC’s tables directory in a freshly created Jekyll 3.10.0 site, and both build in ~30 seconds. So I don’t think the absolute vs relative URLs make a difference on their own.

I then tried building both versions of the full site (main (49199e4) vs 21364973d). Both versions built in about 120-140 seconds over several clean-build cycles. So no obvious difference in built-time between the versions.

My suspicion is that the Github-Pages Action is automatically applying many other plugins to your site which slows down the build (sometimes exponentially so). In particular, the jekyll-relative-links plugin might be the offender – it checks all relative links and potentially rewrites them.

You could try deactivating jekyll-relative-links to see if that allows speedy builds with relative URLs. Add this to your _config.yml (untested):

relative_links:
  enabled:     false
1 Like

I deactivated that plugin and the build time is indeed similar to yours. I had to modify the format of my relative links but it works as expected now. Thank you very much!

1 Like