To enable canonical link for a file:

  1. Edit the file’s metadata, in TYPO3 backend

    Extended sys_file_metadata TCA
  2. Set a page or record, on which this file is located at

  3. After saving metadata, the canonical link get parsed and stored to database

Now, when requesting the file in Frontend, will add additional “Link” HTTP header:

Additional HTTP response header "link", shown in browser's dev tools