Inserting images - /download_file/view_inline

Once upon a time, and I’m not sure when it changed, inserting images through the content block would always show in the “view source” as the ID of the image, but then when you rendered the page, it used the actual URL of the file. In a new installation, I see that inserting an image actually uses

<img src="/download_file/view_inline/20/">

Which is a problem as this is not a .jpg extension and does not cache in a CDN since it is treated as dynamic content. In the past (again, I’m not sure how far back, possibly as far as 5.4), when you would save the page and then view the source it would replace this (something like CCM_IMAGE:80) with the flattened JPG file location:

<img src="/files/3013/3491/myimage.jpg">

Is there a way that this can be achieved again? The view_inline function seems to require the JPG to pass through PHP in order to load which wreaks havoc on load time and server load.

In terms of the URL that the Content block has stored in the database, that has the /download_file/view_inline path as you’ve described.

But when the Content block is actually output, it should translate those into the direct links to the images. Specifically there’s a LinkAbstractor class the Content block (and others) uses to convert those links to the direct ones.
On a quick test that’s what I’m seeing at least, I’m seeing a full path to images in the final HTML source, with a .jpg on the end.

Perhaps you’re only just looking at the source in the block, and not the final output?

I’m so happy to hear that! I just tested another content block on another site and it worked as you described.

I must have a problem with some server configuration or something else that’s causing the LinkAbstractor not work on the site I originally saw the issue on. I’ll post back if I find anything of use!

Sorry, one thing I should clarify, it was in the final output, not just in the editing (as that’s where the speed/load issue showed up which caused me to find that as the source of the problem).

Do you have an alternate storage location (which is outside the web root) set?

No, it uses the same standard setup /application/files/etc