From ec4ab34d83b72bdd44d0f7b86ceba08886f77f5f Mon Sep 17 00:00:00 2001 From: Maxime Rainville Date: Mon, 6 May 2019 16:07:19 +1200 Subject: [PATCH] NEW Disable legacy resolution for new projects --- app/_config/assets.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/_config/assets.yml diff --git a/app/_config/assets.yml b/app/_config/assets.yml new file mode 100644 index 0000000..1ccbd65 --- /dev/null +++ b/app/_config/assets.yml @@ -0,0 +1,26 @@ +# SilverStripe 4.4 changes the way files are resolved. `silverstripe-assets` resolves files using a variety of formats +# by default. When starting a brand new project on SilverStripe 4.4 or greater, those extra formats are not needed and +# will slowdown file resolution requests a bit. This config removes those redundant formats. + +--- +Name: project-assetsflysystem +After: '#assetsflysystem' +--- +SilverStripe\Core\Injector\Injector: + # Define public resolution strategy + SilverStripe\Assets\FilenameParsing\FileResolutionStrategy.public: + class: SilverStripe\Assets\FilenameParsing\FileIDHelperResolutionStrategy + properties: + ResolutionFileIDHelpers: + - '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper' + - '%$SilverStripe\Assets\FilenameParsing\NaturalFileIDHelper' + DefaultFileIDHelper: '%$SilverStripe\Assets\FilenameParsing\NaturalFileIDHelper' + VersionedStage: Live + # Define protected resolution strategy + SilverStripe\Assets\FilenameParsing\FileResolutionStrategy.protected: + class: SilverStripe\Assets\FilenameParsing\FileIDHelperResolutionStrategy + properties: + DefaultFileIDHelper: '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper' + ResolutionFileIDHelpers: + - '%$SilverStripe\Assets\FilenameParsing\HashFileIDHelper' + VersionedStage: Stage