I’m doing a Image Proxy Server and the problem is, some requests take a long time, more than 30s.
How I can improve it to get the objects more quickly?
Maybe the problem is because the requests are not going through the CDN.
My aws sdk js config is:
accessKeyId: '',
secretAccessKey: '',
bucket: 'bucketname',
endPoint: 'ams3.digitaloceanspaces.com',
region: 'ams3'
and this function to get the object from Spaces:
getFile: function(res, file) {
return new Promise((resolve, reject) => {
s3.getObject({ Bucket: 'bucketname', Key: file }, (err, data) => {
//console.log(res, err, data);
if (!err) {
return resolve(data);
} else {
return reject(err, res);
}
});
}).catch((err) => {
console.log('Error:', err.statusCode);
});
},
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.