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

Print: save one request #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FilipChalupa
Copy link
Contributor

No description provided.

@VojtaStanek
Copy link
Contributor

VojtaStanek commented Jul 4, 2017 via email

@FilipChalupa
Copy link
Contributor Author

Of course it will help. Check any project based on mango-cli-example in Google Chrome. Few bytes in index.css is cheaper than requesting another file.

I tried https://moje.rekola.cz and was no way near to printing it.
image

@FilipChalupa
Copy link
Contributor Author

I fact the <link rel="stylesheet" href="/assets/styles/1499088762-print.css" media="print"> has more bytes which cannot be cached than @media print{img,picture{display:none;max-width:100%}} in cacheable index.css.

@enzy
Copy link
Contributor

enzy commented Jul 5, 2017

I would delay the load of a print style instead.

@media print{img,picture{display:none;max-width:100%}}

This is only a default style for print which needs to be extended based on a project you're working on. So it will grow in size.

@FilipChalupa
Copy link
Contributor Author

It "never" does grow in size. Usually in small projects everybody forgets about print style. So merging it with index seems good to me. It saves the one request without any significant consequences. For larger projects coders should implement tailored solution for their specific needs.

BTW delaying print style load means adding more bytes to index.js. That is almost as bad as adding print styles to index.css.

@FilipChalupa
Copy link
Contributor Author

If I may I would suggest getting rid of the default print styles completely. I don't see any reason why images should be skipped while printing. I can accept hiding navigation or adding urls next to <a> tags.

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

Successfully merging this pull request may close these issues.

3 participants