Originally developed by @anoordende from @zumeymedia in #6984.
Original description
This resolves both issue #6981 by normalizing the profile path hash, as well as re-introduces an old CodePlex PR that missed the GitHub boat, namely the ability to purge profiles through the Admin UI.
Normalizing the image profile path
Normalizing the image profile path hash "should" be the default for all new sites, as it allows for changing the domain from which images are served, whilst maintaining the already generated profiles. This enables, for example, 301 SEO-friendly redirects when moving from local storage to azure storage or moving to a CDN by simply redirecting one-to-one at the ^_Profiles/.* level.
Important for Release NotesExisting sites may opt-out from Normalizing the profile paths, especially those which are not serving from the local Media folder, those which use a container other than "media" in Azure Blob Storage and those sites which use a custom storage provider. This can be achieved by setting the following AppSetting to false, which sets the behavior exactly as before:
As mentioned, this PR also enables 2 purge options form the Admin > Media > Profiles view, forcing profiles to be regenerated and old "orphaned" images will be cleared:
Purge all images under an individual profile
Purge all obsolete images, including all dynamic profiles (such as the Admin UI thumbs)
This functionality sits quite naturally with the normalization of the hashes, as those who wish to implement the normalization on existing sites immediately have a function to clear the old profiles (using the Purge Obsolete option). Though for SEO purposes you probably want to wait a few months before doing so.
Additional changes
Deleting a Profile also removes its generated files.
I removed the "Normalizing the image profile path" feature, because I couldn't reliably test it and what I could test did not work. Probably due to incompatibility with changes implemented since this PRs original development. I would opt to the merge the rest of this PR (Purging Profiles), which is a useful and fully working functionality. "Normalizing the image profile path" is interesting in when you migrate a Production site from local (file system) Media storage to Azure Blob Storage and want to keep the images generated by image profiles, but at this point IMO we can live without that.
Fixes #6981
Originally developed by @anoordende from @zumeymedia in #6984.
Original description
This resolves both issue #6981 by normalizing the profile path hash, as well as re-introduces an old CodePlex PR that missed the GitHub boat, namely the ability to purge profiles through the Admin UI.
Normalizing the image profile path
Normalizing the image profile path hash "should" be the default for all new sites, as it allows for changing the domain from which images are served, whilst maintaining the already generated profiles. This enables, for example, 301 SEO-friendly redirects when moving from local storage to azure storage or moving to a CDN by simply redirecting one-to-one at the
^_Profiles/.*
level.Important for Release Notes Existing sites may opt-out from Normalizing the profile paths, especially those which are not serving from the local Media folder, those which use a container other than "media" in Azure Blob Storage and those sites which use a custom storage provider. This can be achieved by setting the following AppSetting to
false
, which sets the behavior exactly as before:<add key="Orchard.MediaProcessing.NormalizePath" value="false" />
Purging Profiles
As mentioned, this PR also enables 2 purge options form the Admin > Media > Profiles view, forcing profiles to be regenerated and old "orphaned" images will be cleared:
This functionality sits quite naturally with the normalization of the hashes, as those who wish to implement the normalization on existing sites immediately have a function to clear the old profiles (using the Purge Obsolete option). Though for SEO purposes you probably want to wait a few months before doing so.
Additional changes