Support subfolder as addition to pull hostname

Created on 5 June 2023, about 1 year ago
Updated 4 October 2023, 9 months ago

Fairly same compared to #3166742: Support for non-hostname-based Origin Pull CDNs (for example: Cloudimage) β†’ .

I would like to have a "folder" optional field besides the current CDN hostname field.

This will allow
https://cdnname.whatever.extention/somefolder/
next to what is possbile right now:
https://cdnname.whatever.extention/

to facilitate for shared CDN usage. where "somefolder" would be currentdomain.extension

Proposed resolution

Add a folder field

✨ Feature request
Status

Closed: works as designed

Version

4.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands halvar_io

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @halvar_io
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    This will allow
    https://cdnname.whatever.extention/somefolder/
    next to what is possbile right now:
    https://cdnname.whatever.extention/

    to facilitate for shared CDN usage. where "somefolder" would be currentdomain.extension

    There's no Origin Pull CDN that supports this to my knowledge? Can you point me to one that does support this? πŸ˜ŠπŸ™

  • πŸ‡¬πŸ‡§United Kingdom aesuk

    I used this module many years ago and it's superb. Recently I've used remote_stream_wrapper to achieve a similar result. But that module is now not suitable. Off the bat we have an issue with our setup. I had a good dig on the issue queue and found this, it's similar to our case.

    www.website.com/sites/website.com/files/images/photo.jpg
    cdn.website.com/sites/website.com/files/images/photo.jpg

    The long path Drupal creates is the issue. We have an existing CDN service with quite a history on google, so we don't want to change our paths. remote_stream_wrapper would be able to handle this because of course you just type in the value manually on every field. But this time we are looking at hundreds of fields so CDN module is the winner.

    Can the module add a setting to ignore /sites/website.com/files/ so the output becomes?

    cdn.website.com/images/photo.jpg

    kinda the reverse of the original post, but the same ballpark.

  • Issue was unassigned.
  • Status changed to Needs review 9 months ago
  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    @aesuk Which Origin Pull CDN are you using that you are having your URLs rewritten like that by the CDN?

    Can the module add a setting to ignore /sites/website.com/files/ so the output becomes?

    Sorry, but no: I don't want to complicate this module for a <0.1% edge case. The >5,000 sites currently using this don't need this setting, so I won't add it.

    It's also the wrong layer of abstraction anyway.

    There's a much simpler solution! πŸ˜„

    1. Open settings.php
    2. Add
      $settings['file_public_base_url'] = 'http://cdn.website.com';
      
    3. Done!
  • πŸ‡¬πŸ‡§United Kingdom aesuk

    oh I didn't know that setting existed, so that did not occur to me. Thank you very very much.

  • Status changed to Closed: works as designed 9 months ago
  • πŸ‡§πŸ‡ͺBelgium Wim Leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    You're very welcome! 😊

Production build 0.69.0 2024