-
Notifications
You must be signed in to change notification settings - Fork 19
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
Only grab necessary subresources #33
Comments
Another optimization could be done for
Could Another thing I came across is in a responsive image, where the |
Thanks for the tips!
The very first implementation of freeze-dry did convert linked stylesheets to
See issue #31. This should be easy to solve. We could e.g. check for PS I’m also always curious to know what people use freeze-dry for. It’s a little sad to only hear about its issues.. ;) |
Besides catching 404s, seems like setting I will at some point try to setup everything so I can play around with the code, however, never used Typescript before, so lets see when I have enough time to check that out.
I can imagine. I'm making a (internal) Firefox extension including Apache WebAnnotator and freezeDry (and probably I'll also use Mozillas Readability to save a plaintext version) that talks to an internal tool to save the data. The idea/plan is to use this whenever we have to research some info on the web that later goes into our database, to be able to document where this info came from. The frozen websites including the annotations will then be shown in an iframe within the tool. |
Maybe? Pay attention to check escaping of Nice to hear your use case! Also good to hear another use case of Apache Annotator (you might have noticed my name a lot in there too..). |
Currently, we inline all resolutions listed in an
<img>
'ssrcset
, all<audio>
and<video>
sources, all stylesheets, etcetera. This makes snapshots huge. The upside is that the snapshot will be as rich as the original, and more likely to work and look as intended in various browsers and screen resolutions. Depending on the application, one or the other factor may be more important, so it would be nice to make configurable how much we grab. Some preliminary thoughts on this:One reasonable desire is to grab only things that are currently in use (if this can be tested for). This could help a lot with speeding freeze-dry up, as those things may be available from cache.
For images with multiple resolutions, we could read
element.currentSrc
, and only grab that one. And/or perhaps get the one with highest resolution.For audio and video, the sources are usually different file formats;
currentSrc
seems a reasonable choice again, or some prewired preference to pick a widely supported and/or well compressed format (again a possible trade-off).For stylesheets, we may filter by media queries, both in a
media
attribute on a<link>
(to omit the whole stylesheet), or@media
at-rules inside stylesheets (to omit the subresources it affects). The next question is then what media queries to fliter for; type (screen/print), window size; possibly again only take what is currently active.For fonts, we could take only the ones currently used/loaded (how? the
status
attributes of fonts indocument.fonts
?). And we could hard-code a preference for some well compressed and/or widely supported file format.The text was updated successfully, but these errors were encountered: