How to identify and reduce bandwith of a book website?

My issue is related to Excessive Bandwidth Usage

I’m seeing usage in excess of 100 GB regularly, and am wondering how I can reduce that, to avoid paying for an open source book that we’re putting up for public benefit. See the book here: https://geocompr.robinlovelace.net

I imagine the best way forward is to create a break-down of the files responsible. Any ideas how I would do that? I suspect it’s due to the content in the most popular chapter: https://geocompr.robinlovelace.net/adv-map.html

But any evidence of this would be greatly appreciated and will help reduce bandwidth use and costs.

Here’s a breakdown of the most popular pages over the last 7 days:

image

Hoping to stay on Netlify but will consider alternatives if this issue cannot be resolved.

Hi Robin,

First of all, thank you for Open Sourcing the book!

One quick thing i could suggest is to enable Netlify Analytics for 1 month, you will see immediately what links/resources are eating up your bandwidth, it could be that some urls are return 404, so you have to understand the exact situation before you act, and i think that worth 9$.

You can look for low-hanging fruits like pages which returning 404s, we can help you with the specifics.

Once you eliminated the obvious issues you can optimize you current setup, you have to look into what the pages are loading and eliminate what is not necessary in that particular page.
I did a quick Glimpse to the site and it seemed that you load a lot of js and css files, i would say you have to make sure you only load the files you absolutely need in a particular chapter page:

In the attached screenshot i highlighted what i think needs to only load in pages where you need it.
I’m not fully understand how you generate site but i’m sure you are (were) gitbook and the static pages can be found in the gh-pages branch

You also have a 404 to the favicon.ico file which you can either delete or set it to something.
I went deep into your repo, but didn’t find the place where all these files are linked to page there are a bunch of build script and not sure which one is in use.

Good luck!

Hi @zltnvrs thanks for the suggestion, but that involves spending more money. A simpler solution, that I will try first, is to identify the large files in the popular pages and host them elsewhere. That’s my plan A. I suspect the images are more bandwidth consuming that the .css and .js files.

FYI open source teams qualify for free unlimited members, see here. I can’t find anything on there about getting more than 100gb for open source projects, however perhaps it’s something Netlify might consider in the future if someone asks them nicely.

@Robinlovelace - send me an email to perry@netlify.com outlining a bit what your site does, who participates, who it’s for, etc. We do have an Open Source program, but most folks who apply are using us to host collaborative software projects. Not sure we’ve had a book before, but we’ll definitely consider supporting it!