Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageProfile paths need to exclude host to allow 301 redirects on domain moves #6981

Closed
anoordende opened this issue Jun 16, 2016 · 1 comment · Fixed by #8788
Closed

ImageProfile paths need to exclude host to allow 301 redirects on domain moves #6981

anoordende opened this issue Jun 16, 2016 · 1 comment · Fixed by #8788
Milestone

Comments

@anoordende
Copy link
Contributor

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...

@anoordende 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
anoordende added a commit to zumeymedia/Orchard that referenced this issue Jun 17, 2016
@anoordende
Copy link
Contributor Author

Pull request created: #6984

@sfmskywalker sfmskywalker added this to the Orchard 1.11 milestone Jun 30, 2016
@sebastienros sebastienros modified the milestones: dev, Orchard 1.11 Jul 21, 2016
BenedekFarkas added a commit that referenced this issue May 3, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants