How do file asset webpaths get determined?


(Douglas (@finnatic at @waikato)) #1

How do file asset webpaths get determined?

We have file assets under a site with several domains in the webpath, but when I look at the webpaths for the files that I’ve checked, they only show one of the domains?


(Marcus Fong) #2

It might be worth trying the system_update_lookups.php script:

https://matrix.squiz.net/manuals/server-administrator/chapters/system-management-scripts#system_update_lookups.php


(Douglas (@finnatic at @waikato)) #3

We have a different System Static URL set on the system in question (per https://matrix.squiz.net/manuals/system-configuration/chapters/system-configuration#System-URL-Settings), and that’s set as a fully qualified domain name (e.g. the single domain)

I’m assuming that’s probably explains what we’re seeing?


(Marcus Fong) #4

Ah, yes - that would explain it. System Static URL is usually only used for offloading to a different system, like a CDN.

I believe in the past it was also sometimes used on a single server to serve static files from a lightweight webserver like lighttpd, allowing Apache’s more heavyweight processes to be reserved for running Matrix’s PHP code. I don’t think that configuration was common even then, though, and moving to PHP-FPM (as we do with Nginx/Openresty) completely eliminates the need for it.


(Douglas (@finnatic at @waikato)) #5

We’ve ended up with two separate Squiz Matrix servers, both of which are serving content out through another system via reverse proxy setup.

The __data/ address is mapped to one, and a different address is mapped to the second.

(I’d really love a Squiz Matrix Server bridge which would allow us to unify our setup a little, but haven’t got the nascent idea ready for squizmap or similar).


(Marcus Fong) #6

Oh, I see. I’m not sure how much a bridge would help with __data URLs, though, because they bypass Matrix entirely and are served purely as static files for increased performance. Having to execute PHP code would basically defeat the purpose of having __data in the first place.


(Douglas (@finnatic at @waikato)) #7

My thinking is that having a bridge would allow those of us with, or considering, multiple instances of Matrix to better handle :

  • the editor / admin frustration around where they’re confused around which system to access to edit / admin content
  • pseudo CDN approaches to having all static files available from a single webpath
  • improved handling of url linking to resources external to Matrix instances

(Marcus Fong) #8

I understand your rationale for wanting a bridge, what I mean is that if a Matrix bridge were to apply to __data URLs it would basically defeat their purpose.

The entire point of having __data URLs is that you don’t need to execute any PHP code at all. Otherwise, you may as well switch Unrestricted Access off and use a normal URL.


(Douglas (@finnatic at @waikato)) #9

I’m thinking in terms of exposing static files from one system to editors working via _edit or _admin on a separate system.

At that point, some kind of “bridge” connectivity would avoid situations where they have to currently manually copy and paste the __$static_url/various-values/filename.ext link which may go bad if the asset is updated on the second system.

Has Squiz ever identified a solution for a client with two instances of Matrix where users were wanting an easy way to link to static resources off another? And that would prevent broken links getting formed?


(Aleks Bochniak) #10

Sounds like this is more of an implementation problem on your end, rather than a problem with how Squiz Matrix handles static files.