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

No good way to handle a LOT of assets #618

Open
ZizoAdam opened this issue Nov 5, 2023 · 7 comments
Open

No good way to handle a LOT of assets #618

ZizoAdam opened this issue Nov 5, 2023 · 7 comments

Comments

@ZizoAdam
Copy link

ZizoAdam commented Nov 5, 2023

Angular also didn't have a good way of handling this problem IIRC so it's definitely not common but basically I have about 100,000 images for my little website I'm remaking in Rust and that's just too many things to copy every single code change.

A way to mark a directory to be left alone between builds would potentially be a decent way to solve this if you intend to, as for my current usage it makes trunk serve unusable.

The workaround I have used in the past of uploading the files to a separate github repository and linking to that has caused at least one person I know of some issues with github moderation.

Copy link

github-actions bot commented Dec 6, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Dec 6, 2023
@ctron ctron removed the Stale label Dec 6, 2023
@psionic-k
Copy link

If you have this many assets, you really would just want to serve them with separate server and rely on the proxy support. In production as well, the tendency is to dedicate a static server for assets beyond things that need quick loading speed. Since these static servers are very easy to configure and easy to proxy, this solution makes more sense than adding complication to trunk.

@ZizoAdam
Copy link
Author

ZizoAdam commented Mar 1, 2024

My use case involved me wanting to host on github pages for free, so I didn't want to make a separate server that I'd likely have to pay for.

@psionic-k
Copy link

The problem is not serving the eventual static result but the cost of rebuilding the client during development.

On the production server, Github pages in this case, you don't need a separate static server or any proxying. Trunk isn't even running there. Github pages will serve the images as long as you move them to the right place, which is configured by your deployment action.

Because your page under development behaves as if it is being served from one domain, Trunk supports numerous proxy options, allowing you to replicate the work that Trunk should not be doing, such as serving API requests.

Since Trunk is being clogged up with the 100k images, you should employ its proxy capability to offload that work in development. Locally, before you start trunk, you would start run something simple like httpd or static-web-server and proxy the images requests to it based on path.

As far as automating how you run this secondary proxy backend, I suppose it could be integrated into the proxy behavior, but these sorts of task-runner automations have numerous solutions out there already, and you would use that to run the proxy and then trunk.

Recommend closing.

@ctron
Copy link
Collaborator

ctron commented Mar 4, 2024

My use case involved me wanting to host on github pages for free, so I didn't want to make a separate server that I'd likely have to pay for.

I doesn't need to be a second server, it could also be a second github report, hosting static files.

Anyway, I am open to PRs on this matter. But I think there are better ways to do this.

@ZizoAdam
Copy link
Author

ZizoAdam commented Mar 4, 2024

it could also be a second github repo

I have done that in the past, but someone who did the same actually got their account closed over it. Github staff don't like it so I made a new version that had it all in one repo.

I think there are better ways to do this

This is a pretty specific scenario and I imagine most people who have 10000+ assets aren't trying to host them statically on github pages. Nonetheless it's a scenario that came up for me and thought it would be worth bringing up.

@ctron
Copy link
Collaborator

ctron commented Mar 4, 2024

Nonetheless it's a scenario that came up for me and thought it would be worth bringing up.

Absolutely. I just don't expect much enthusiasm of anyone to work on this. Of course, if you want to come up with a PR, that would be a valuable improvement.

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