Find out how large the image will appear and whether the interface uses a square, portrait, or wide crop. Start from the original file, set appropriate dimensions with an image resizer, and create smaller variants when the site displays several sizes.
Keep enough pixels for sharp viewing on high-density screens, but do not send a huge source file for a tiny thumbnail. Compare the exported image at its real display size for text sharpness, artifacts, transparency, and color. Compression can help delivery, but evaluate the output rather than assuming a file-size target guarantees quality.
Keep the original and document which export serves which placement.