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

Move pics to static/ if possible #214

Open
Huge opened this issue Sep 30, 2024 · 4 comments
Open

Move pics to static/ if possible #214

Huge opened this issue Sep 30, 2024 · 4 comments

Comments

@Huge
Copy link

Huge commented Sep 30, 2024

Why are those pictures in src directory? Stops my hacky workflows with supplying all the code to AIs.-}

➜ ~ du -sh pauseai-website/src/assets/quote-bg/*
7.4M pauseai-website/src/assets/quote-bg/altman.jpg
288K pauseai-website/src/assets/quote-bg/amodei.jpg
6.1M pauseai-website/src/assets/quote-bg/bengio.jpg
252K pauseai-website/src/assets/quote-bg/biden.jpg
20K pauseai-website/src/assets/quote-bg/black.jpg
196K pauseai-website/src/assets/quote-bg/brockman.jpg
80K pauseai-website/src/assets/quote-bg/butler.jpg
128K pauseai-website/src/assets/quote-bg/cais_statement.jpg
4.0K pauseai-website/src/assets/quote-bg/dark_grey.jpg
132K pauseai-website/src/assets/quote-bg/for-cais-statement
356K pauseai-website/src/assets/quote-bg/gates.jpg
204K pauseai-website/src/assets/quote-bg/guterres.jpg
136K pauseai-website/src/assets/quote-bg/harris.jpg
316K pauseai-website/src/assets/quote-bg/hassabis.jpg
56K pauseai-website/src/assets/quote-bg/hawking.jpg
96K pauseai-website/src/assets/quote-bg/hinton.jpg
168K pauseai-website/src/assets/quote-bg/jun.jpg
11M pauseai-website/src/assets/quote-bg/lecun.jpg
156K pauseai-website/src/assets/quote-bg/leyen.jpg
16K pauseai-website/src/assets/quote-bg/light_blue.jpg
4.0K pauseai-website/src/assets/quote-bg/light_grey.jpg
216K pauseai-website/src/assets/quote-bg/musk.jpg
20K pauseai-website/src/assets/quote-bg/old.jpg
144K pauseai-website/src/assets/quote-bg/pope.jpg
76K pauseai-website/src/assets/quote-bg/putin.jpg
384K pauseai-website/src/assets/quote-bg/qiang.jpg
240K pauseai-website/src/assets/quote-bg/russell.jpg
172K pauseai-website/src/assets/quote-bg/suleyman.jpg
504K pauseai-website/src/assets/quote-bg/summit_declaration.jpg
264K pauseai-website/src/assets/quote-bg/sunak.jpg
308K pauseai-website/src/assets/quote-bg/tallinn.jpg
188K pauseai-website/src/assets/quote-bg/trump.jpg
168K pauseai-website/src/assets/quote-bg/turing.jpg
1.6M pauseai-website/src/assets/quote-bg/white.jpg
364K pauseai-website/src/assets/quote-bg/yudkowsky.jpg

@Reginred
Copy link
Contributor

Reginred commented Oct 2, 2024

The advantage of src/assets is that Vite adds the hash to the file name to make caching easier

@Huge
Copy link
Author

Huge commented Oct 2, 2024

Gotcha. Maybe use vite-plugin-static-copy plugin for that?-)

Also stupid and irrelevant Q: how can vite be run/used on this project? It's not mentioned in the Readme.

@anthonybailey
Copy link
Collaborator

anthonybailey commented Oct 3, 2024 via email

@Reginred
Copy link
Contributor

Reginred commented Oct 3, 2024

@Huge

Gotcha. Maybe use vite-plugin-static-copy plugin for that?-)

Not sure how that would work, it seems like the plugin can only copy files, and Vite also modifies the imports.

Also stupid and irrelevant Q: how can vite be run/used on this project? It's not mentioned in the Readme.

SvelteKit is built on top of Vite (which isn't obvious, so more documentation probably wouldn't hurt).

@anthonybailey

Some docs re how Netlify (as a CDN based web server) and Svelte (with its
own configurable caching of assets and page content) work together would be
helpful.

My understanding is the following:

  • The Netlify adapter generates a _headers file for Netlify, which makes it serve everything in build/_app/immutable with a Cache-Control header that tells the CDN and the browser to cache really long because everything in there has the hash in the filename.
  • All other static files are cached on the CDN until a new version is deployed. Browsers can request the content conditional on it having changed via the If-None-Match header.
  • Dynamic routes aren't cached unless an appropriate header is supplied, and Edge functions also need to explicitly opt in to caching.
  • SvelteKit only generates the static files and the edge function (via the adapter), nothing else is run that could cache anything.

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