You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SEO and user-friendlyness is probably the main driver for resolving this issue. Currently the function ImageProfileManager.FormatProfilePath includes the full URI to calculate the hashes for the processed images, e.g when using Azure storage with a public host: https://mystore.blob.w.c.net/media/Foo/Bar/image.png
This means that, when moving domains or switching to e.g. a CDN, it is virtually impossible to create clean 301 redirects because you would have to calculate and redirect each individual hash. Whereas, if the hashes were solely generated on the directory part of the path (ie. discarding protocol, host, app relatives, etc.) it would be as easy as redirecting everything under _Profiles/* as the hashes will be the same.
Long story short, I propose to normalize the hashed profile paths just on the path portion so that they become agnostic.
As per usual, I will create a pull request for this momentarily, probably targeting dev. I think an option to switch this off for existing sites is also in order, to prevent a global recalculation of hashes...
The text was updated successfully, but these errors were encountered:
anoordende
changed the title
ImageProfile path's need to exclude host to allow 301 redirects on domain moves
ImageProfile paths need to exclude host to allow 301 redirects on domain moves
Jun 17, 2016
…8788)
* #6981 Normalized image profile path hash and added profile purging
* Profile purge functions rather belong in IImageProfileService
* Deleting an Image Profile now also removes all its files too
* Comment formatting
* Caching the value of the "Orchard.MediaProcessing.NormalizePath" app setting in ImageProfileManager
* Code styling in ImageProfileManager
* Formatting and code styling ImageProfileManager
---------
Co-authored-by: Arjan Noordende <arjan@zumey.com>
SEO and user-friendlyness is probably the main driver for resolving this issue. Currently the function
ImageProfileManager.FormatProfilePath
includes the full URI to calculate the hashes for the processed images, e.g when using Azure storage with a public host:https://mystore.blob.w.c.net/media/Foo/Bar/image.png
This means that, when moving domains or switching to e.g. a CDN, it is virtually impossible to create clean 301 redirects because you would have to calculate and redirect each individual hash. Whereas, if the hashes were solely generated on the directory part of the path (ie. discarding protocol, host, app relatives, etc.) it would be as easy as redirecting everything under _Profiles/* as the hashes will be the same.
Long story short, I propose to normalize the hashed profile paths just on the path portion so that they become agnostic.
As per usual, I will create a pull request for this momentarily, probably targeting dev. I think an option to switch this off for existing sites is also in order, to prevent a global recalculation of hashes...
The text was updated successfully, but these errors were encountered: