Improve speed#24
Closed
JaeseokWoo wants to merge 3 commits intoAndrejGajdos:masterfrom
JaeseokWoo:performance-branch
Closed
Improve speed#24JaeseokWoo wants to merge 3 commits intoAndrejGajdos:masterfrom JaeseokWoo:performance-branch
JaeseokWoo wants to merge 3 commits intoAndrejGajdos:masterfrom
JaeseokWoo:performance-branch
Conversation
request abort stylesheet, font, media , etc
it is necessary that the resource type is 'script'
Author
|
I think it is necessary that the resource type is 'script'. Block unnecessary resourcesawait page.setRequestInterception(true);
page.on('request', req => {
switch (req.resourceType()) {
case 'stylesheet':
case 'font':
case 'beacon':
case 'media':
case 'main_frame':
case 'websocket':
case 'sub_frame':
req.abort();
break;
default:
req.continue();
}
});Test Result
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Owner
|
@JaeseokWoo that looks really good. Sorry I didn't check this sooner. I was too busy. Can you please remove your |
to keep "lockfileVersion": 2 in this library.
Author
|
@AndrejGajdos Thank you for the reply. |
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello
I learned link-preview-generator during the project.
After using it, I thought it was slow, so I looked at the source code.
Find something to improve.
Block unnecessary resources
Testing
Processor: Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz 2.11 GHz
RAM: 8.00GB
OS: Windows 10 Home
node: v14.17.3
npm: 6.14.13
Test Result
finish
I want to help improve link-preview-generator performance.
I am currently a student, and I am not good at English.
That's why the above content is a translator.
Anyway, I would appreciate it if you could leave a feedback.
I like feedback.