I am looking to programmatically get the aggregated url that I can use to pre-load on a different page. Is there a method I can use in Drupal 8 to do this?

this url usually looks like:


  • Something like "the" aggregated asset URL does not exist. The generated assets are depending the module libraries and will vary page by page – Hudri Nov 15 '19 at 6:54
  • How about getting the aggregated url for a node (another page) – Anon Nov 15 '19 at 6:58
  • I don't have an answer on this, you might get some information if you google about "Drupal placeholder token" or look for the same term on this site. But what you are trying to do is conceptionally prone to errors, as modules can declare assets to be loaded either in header or footer, or even later on a separate Ajax call. – Hudri Nov 15 '19 at 7:07
  • I have never tried this before, but I think you can do this by using the advagg module together with brotli, to create a static file to use for pre-loading. – user72672 Nov 15 '19 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.