Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing PDFs and images #222

Open
wipfli opened this issue Aug 7, 2023 · 7 comments
Open

Storing PDFs and images #222

wipfli opened this issue Aug 7, 2023 · 7 comments

Comments

@wipfli
Copy link
Contributor

wipfli commented Aug 7, 2023

In recent pull requests there has been some discussion about how to best store PDFs and images.

What we are doing at the moment is to have some pdfs / images in this git repo and some we get from 3rd party sources such as GitHub or Google Drive.

I think having multiple places to store images and pdfs is bad.

What is the best solution to this? cc @maxammann and @louwers

@maxammann
Copy link
Contributor

Hm, storing everything on GitHub does not work (google docs etc.).
Storing everything on Google Drive does also not work because images would not be embedable.

So there is probably no solution.

@louwers
Copy link
Collaborator

louwers commented Aug 7, 2023

Binary blobs bigger than a few KB should not be stored in a git repo. It will make cloning the repo very slow and if they are ever deleted they are still part of the git history. Also, with GitHub Pages the whole site cannot be more than 1GB which you would hit very quickly, and there is also a 100 GB bandwidth limit.

What I like to do is drag-and-drop images in GitHub editors (or you can click the text "Attach files by dragging & dropping"). It will get uploaded to GitHub's CDN. Here is a visual guide:


Source

Another advantage is that GitHub will do compression for you so you don't have to do it manually (it's really sloppy to accompany a newsletter with a 3MB image). Oh, you can also upload PDFs this way.

If that feels a bit shaky (uploaded images and files have no expiry but they could in theory disappear) we can set up an S3 bucket to upload images and files there. I would be happy to set up an account and the bucket.

@louwers
Copy link
Collaborator

louwers commented Aug 7, 2023

This tool can be used to delete existing binary files from the repo: https://rtyley.github.io/bfg-repo-cleaner/

@wipfli
Copy link
Contributor Author

wipfli commented Aug 9, 2023

I think it is best to use Cloudflare R2 to store binary files.

@wipfli wipfli closed this as completed Aug 9, 2023
@wipfli
Copy link
Contributor Author

wipfli commented Aug 9, 2023

Thanks for the feedback everyone!

@louwers
Copy link
Collaborator

louwers commented Sep 16, 2023

@wipfli Happy to use Cloudflare R2, but it is tied to [email protected], so I am unable to log in (2 factor auth).

@louwers louwers reopened this Sep 16, 2023
@louwers
Copy link
Collaborator

louwers commented Oct 31, 2023

My connection is not the fastest right now, but after changing a single text file, git took several minutes to push a branch (uploading 18.89 MiB with 88.00 KiB/s).

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants