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

Added a cache for responses to fonts #336

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Nikitozz13
Copy link

Because of many duplicated fonts downloading need to add a cache for them to prevent that.
This PR based on @kumarsai solution.
On my project it reduced all the responses in several times! So it download the font only once and reuse the response for the further requests to the same font.

Issue: #37

@Nikitozz13 Nikitozz13 changed the title A response cache has been added since they can download already downloaded fonts Added a cache for responses to fonts May 15, 2020
additv pushed a commit to additv/dom-to-image that referenced this pull request Jun 18, 2020
InYourHead pushed a commit to InYourHead/dom-to-image that referenced this pull request Sep 17, 2020
InYourHead pushed a commit to InYourHead/dom-to-image that referenced this pull request Sep 17, 2020
@InYourHead
Copy link

I merged this PR to my repository and I can confirm that this fix speed up whole operation.

IDisposable added a commit to 1904labs/dom-to-image-more that referenced this pull request Sep 7, 2022
This eliminates the constant redownloading of referenced fonts images and such. The cache is cleared after the completion of  the toSvg  method and is based on the requested URL, not the cache-busted URL. Based on the work in  tsayen#336 and resolves #79
@IDisposable
Copy link

This is released in dom-to-image-more 1.12.0

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

Successfully merging this pull request may close these issues.

None yet

3 participants