Added a not on media inlining perf improvement
refs https://github.com/TryGhost/Toolbox/issues/524 - Fetching media from a remote server is an expensive network operation. Given there's probability for the content to reuse the same image in different posts or in multiple places, we could save on extra fetches by adding caching to the remote media fetch method
This commit is contained in:
parent
831a76505c
commit
93ea9a2976
@ -40,6 +40,8 @@ class ExternalMediaInliner {
|
||||
* @returns {Promise<Object>}
|
||||
*/
|
||||
async #getRemoteMedia(requestURL) {
|
||||
// @NOTE: this is the most expensive operation in the whole inlining process
|
||||
// we should consider caching the results to improve performance
|
||||
try {
|
||||
return await request(requestURL, {
|
||||
followRedirect: true,
|
||||
|
Loading…
Reference in New Issue
Block a user