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

Wiki on actual things you can do/read? #46

Open
jtagcat opened this issue Aug 26, 2020 · 1 comment
Open

Wiki on actual things you can do/read? #46

jtagcat opened this issue Aug 26, 2020 · 1 comment

Comments

@jtagcat
Copy link
Contributor

jtagcat commented Aug 26, 2020

Caching. I have minimal idea on how it works.

Is a CSS file for only the things needed on each page or a common CSS file better? Does the CSS file get downloaded every time?

@KeenRivals
Copy link
Owner

A very brief overview is that when the server sends a file it can include an Expires and/or Cache-Control header, which tells the browser when it needs to refresh that content. Until that time passes, the browser can choose to use the cached copy of the file. At BMFW I use Apache's mod_expires to set a +1 week expiration on the content via .htaccess.

The nuts and bolts of it is usually you want to provide a separate CSS file and let browsers cache that. Some people argue that in-lining your important CSS in your pages helps browsers do initial rendering faster since it doesn't have to do an extra fetch. My response to that is if web pages weren't obscenely large to begin with the paint issues would be totally negligible. But, I'll admit that over poor network connections, extra fetches can perform badly. I prefer to keep it very simple and just keep the CSS separate. IMO the best way to help people with bad connections is to keep page + resource weight as small as possible.

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

2 participants