<web-tuning>
<webroot>
<folders-fixed-caching>
<!--This will cache all assets under photos/ directory for 1 year-->
<enabled age-unit="YEARS" age="1" folder-path="photos/*"/>
<!--This will cache all assets under photos/customers directory-->
<enabled age-unit="YEARS" age="1" folder-path="photos/customers/*"/>
</folders-fixed-caching>
</webroot>
</web-tuning>
Validating caching algorithm example
URL : webroot/photos/mega/banners/huge.png
Check photos/mega/sub/another/banners/
Check photos/mega/sub/another/banners/*
Check photos/mega/sub/another/*
Check photos/mega/sub/*
Check photos/mega/*
Check photos/*
Performing this validation for every single asset will add some significant overhead even to assets that aren't cached. To reduce the overhead, a hinting method must be implemented
<web-tunning>
<webroot>
<folders-fixed-caching>
<!--This will cache all assets under photos/ directory recursively for 1 year-->
<enabled age-unit="YEARS" age="1" folder-path="photos/*"/>
<!--This will cache all assets under photos/customers directory recursively-->
<enabled age-unit="YEARS" age="1" folder-path="photos/customers/*"/>
<!--This will tell the Assets requests handler to not worry about files under photos/whatever/path/ recursively because they arent cached-->
<no-cache-hint path="photos/whatever/path/*"></no-cache-hint>
<!--This will tell the Assets requests handler to not worry about files under photos/whatever/path/ (not recursively) because they arent cached-->
<no-cache-hint path="photos/whatever/path/"></no-cache-hint>
</folders-fixed-caching>
</webroot>
</web-tunning>
Validating caching algorithm example (considering hints)
Defining static caching
Validating caching algorithm example
URL : webroot/photos/mega/banners/huge.png
Performing this validation for every single asset will add some significant overhead even to assets that aren't cached. To reduce the overhead, a hinting method must be implemented
Validating caching algorithm example (considering hints)
URL : webroot/photos/mega/banners/huge.png