Skip to content

Commit

Permalink
PRESIDECMS-2717 Permanent redirect to inline assets with a public URL
Browse files Browse the repository at this point in the history
Permanent redirect can then be cached more agressively by proxies, etc. which
will save on traffic being processed by the application unnecessarily.

We still need a *temporary* redirect for assets like PDFs that are served
as attachments in order to first record download actions for users. We do
NOT want to do this for inline images in pages!
  • Loading branch information
DominicWatson committed Sep 27, 2023
1 parent f103aa4 commit d39e913
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion system/handlers/core/AssetDownload.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ component {
if ( !ReFindNoCase( "^/asset/", assetPublicUrl ) && event.getCurrentUrl() != UrlDecode( assetPublicUrl ) ) {
setNextEvent(
url = assetPublicUrl
, statusCode = "302"
, statusCode = type.serveAsAttachment ? 302 : 301
);
}

Expand Down

0 comments on commit d39e913

Please sign in to comment.