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

Prune and compress images #53

Open
heyellieday opened this issue Feb 4, 2017 · 7 comments
Open

Prune and compress images #53

heyellieday opened this issue Feb 4, 2017 · 7 comments

Comments

@heyellieday
Copy link

Upon pulling the repository for the first time, I noticed it was nearly 200mb in size:

image

I think that it would be beneficial to trim the assets stored in the repo, which on disk are roughly 48mb, but I am unsure if that would reduce the size of the repo when initially pulled, based on my initial research: http://stackoverflow.com/questions/8185276/find-size-of-git-repo

If reducing the size of assets store in the repo can reduce the initial size, then an option such as storing the large assets (mostly images) with a static storage provider like Amazon S3 might be worth looking into.

@hagata
Copy link
Contributor

hagata commented Feb 4, 2017

This may be helpful, too
http://stevelorek.com/how-to-shrink-a-git-repository.html

It seems that there are a number of images that are not being used on the website that could be cleaned out. Maybe I'm just not seeing them? For example, the static/workshops/ directory images.

I'm working on #1 & #4 which will include running all the current images through imageoptim.

@heyellieday
Copy link
Author

@hagata, good to know. I think the work in #1 and #4 combined with using A CDN (https://en.wikipedia.org/wiki/Content_delivery_network) for the compiled assets in production will help the performance on slower clients, but that's probably best discussed in a separate issue.

@hagata
Copy link
Contributor

hagata commented Feb 4, 2017

@heyellieday, Yeah, the work for the site performance won't solve this issue.

@MichelleGlauser
Copy link
Member

Is this the same as this issue?

@hagata
Copy link
Contributor

hagata commented Feb 6, 2017

@MichelleGlauser Yes, partially. #3 refers mostly to binary assets, but the root of the issue is the same as this.

@KGmajor KGmajor changed the title Large repository size on initial "git clone" Prune and compress images Jul 25, 2019
@MichelleGlauser
Copy link
Member

We still do not have a solution for this.

@gsong
Copy link
Collaborator

gsong commented Feb 7, 2021

There are really three issues here.

Repo Is Too Large

I recommend we migrate to git-lfs to handle this problem. I can convert this repo to use LFS.

Optimize Images

There's a number of ways to approach this, but the easiest is to probably just do it locally for now when there are new images. On the Mac, just use ImageOptim. We should make an effort to optimize an image before it's committed to the repo the first time.

For vector art, such as icons and logos, we should migrate to SVGs when possible.

Prune Images

I don't think we want to remove images from the repo history altogether. Instead, we want to keep static/img/ directory up to date by pruning the directory of images that are no longer relevant.

gsong added a commit that referenced this issue Feb 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants