"An invalid/missing hash value was encountered" error when browsing SXA sites


Description

A message similar to the following might be found in the logs when browsing an SXA site:

ERROR MediaRequestProtection: An invalid/missing hash value was encountered. The expected hash value: 8A73EFF588CB444F269A9BB6F17258DC. Media URL: /-/media/Base-Themes/Core-Libraries/scripts/optimized-min.js?rev=c2ee6980a2e54e20b3b1806cf2d63480&t=20190410T105842Z, Referring URL: http://sc902x181/

The issue occurs when the value of the Media.AlwaysAppendRevision setting is set to true.

Solution

To resolve the issue, consider one of the following options: