system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does MEGA.nz download files within the website before downloading them to my computer instantly?
gpt
The files are not downloaded to your cache, they're downloaded to your browser local storage. This is different to a cache, as the cache is a way to store website assets that are reused on subsequent visits (think website images, favicons, fonts, stylesheets).

Local storage is something akin to actual storage that can be utilised by a website to store, manage, and update data within it. Think persistent data (rather than temporary cache), and in the case of Mega, the file you're downloading.

The way Mega works, is it streams encrypted bytes to your local storage (this process can show the download progress percentage etc.). Once the stream is finished, client side scripts decrypt the file in your local storage and send a save file prompt to your browser referencing the file in storage. The browser then "downloads" the file, and since it's already on your machine, it's instant.