Use Kraken.io to optimize images

Hi,

I am optimizing the images in my site to improve my loading time and my storage space. I have users that upload images, therefore what I am looking for its to optimize the images that the user uploads, for this, I am planning to use Kraken.io npm.

I have to:

  1. Get the file that the user uploads
  2. Send it to Kraken via my api keys
  3. Retrive the response and download the image file into my WiX acc
  4. Link this image to the user

The ideal path is to make step 1 and 2 withouth having the file uploaded first in my WiX acc.

My question is:
A) How can I upload a file to my backend without uploading it to my WiX acc? Or in other words, how can I send a file from a user to the Kraken environment without uploading it to my WiX acc?

I have tought about an HTML element, though I still dont know on hoe to get the user file without uploading into my WiX acc,

Thank you.

Best,
Miguel

First, Wix makes an attempt to optimize image loading and rendering. If you need further details or clarification, I would recommend contacting Wix Customer Care , as they know best. It’s worth checking with them first before expending a lot of energy for another solution. With that in mind…

You should check with Kraken to see if they have a REST interface. If so, then you can use the wix-fetch API to connect to their service. You will need to read about how to access 3rd party services in the article Corvid: How to Access 3rd-Party Services with the Fetch API .

A nice simple example to start with is Create a Weather Widget . Also, t ake a look at the Advanced examples , many of them access 3rd party services. A couple of good examples to start with are: Example: Using the Places API from Google Maps services and Example: Send email with the SendGrid REST interface .

Hi Yisrael,

I did improved my loading time by resizing and optimizing the images prior upload. A quick static tip is to upload it to Facebook and then download it, it went from over 1MB to 300Kb, and with resize first it cut to less than 100Kb.

Great tips, as u said ill check with customer care first, as this indeed seems to require work. Also, I didn tthink about the wix-fetchAPI, so I’ll dig in the examples you mentioned.

Thank you!

Best,
Miguel

The reason that the FB image is smaller, is that FB doesn’t optimize the images, (afaik) FB caps the resolution on posted images to make the file size smaller.

Wix does some of that behind the scenes, and I believe that some "optimization"can be handled from the Dashboard and the Media Manager. The support team will know best.