No Code Attached Yet
avatar DanieleAsrael
DanieleAsrael
11 Feb 2026

Why this should be fixed

This behavior causes significant performance and stability issues:

  • Memory Exhaustion: For large assets like videos (e.g., 30MB or more), the server must load the entire file into memory to encode it, and the browser must handle a massive JSON string, often leading to crashes or "Out of Memory" errors.
  • Bandwidth Waste: It is technically redundant to transfer 100% of a file's data just to display a text string (the URL) to the user.
  • Latency: The time required to encode and transmit the Base64 string makes the "Get Link" feature feel slow and unresponsive for anything larger than a small thumbnail.

How would you fix it

The fix involves decoupling the "Get Link" request from the generic "Get Full Contents" logic to ensure the Base64 content is only loaded when strictly necessary.

1. Frontend Action Logic (actions.es6.js):

  • Introduce a new Vuex action getShareableContents.
  • This action calls the API via api.getContents(payload, true, false).
  • By setting the third parameter to false, we prevent the backend from encoding the file stream into the JSON response.

2. Component Integration (share-modal.vue):

  • Update the generateUrl method to dispatch the new getShareableContents action instead of the previous full content fetch.

3. Backend Efficiency (ApiModel.php):

  • In ApiModel.php, when the third parameter ($options['content']) of getFile() is false, the logic that executes base64_encode(stream_get_contents($resource)) is bypassed.
  • This ensures the server only returns the URL and metadata, significantly reducing CPU and memory usage.

Side Effects expected

None. Removing the Base64 content from the "Get Link" modal will not affect the file's availability or the correctness of the generated URL. It will result in a significantly faster and lighter XHR request.

Image
avatar DanieleAsrael DanieleAsrael - open - 11 Feb 2026
avatar joomla-cms-bot joomla-cms-bot - change - 11 Feb 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 11 Feb 2026
avatar DanieleAsrael DanieleAsrael - change - 11 Feb 2026
The description was changed
avatar DanieleAsrael DanieleAsrael - edited - 11 Feb 2026
avatar DanieleAsrael DanieleAsrael - change - 11 Feb 2026
The description was changed
avatar DanieleAsrael DanieleAsrael - edited - 11 Feb 2026
avatar brianteeman
brianteeman - comment - 17 Feb 2026

Please see #44848

Add a Comment

Login with GitHub to post a comment