I have the challenge that I want my site to be cache-able by and external varnish cache provider.

Most of my page gets cached nicely, but elements like the ico file, images and css are written with the full url in code and hence doesn't use the cached version.

www.domain.com points to internal.domain.com

When I go to www.domain.com the urls for the images looks like this


What I wanted was that it just wrote a url relative to the root of the site.


The issue is the same with files included from the THEME.libraries.yml file.

1 Answer 1


Core actually did exactly that change just a few days ago, it will be like that in 8.0.3.

That said, your set up looks problematic to me, that's not going to be the only thing that somehow relies on the domain name. Usually the same domain is used?

  • I am going to use Fastly as Caching service. They are going to get www pointed to them. Then I have a backend site that will be named internal.domain.com where Drupal lives. What solution would you else suggest?
    – Jonasdk
    Feb 2, 2016 at 9:59
  • Thanks for the pointer to the fix in 8.0.3 here is the link for the patch that fix my issue drupal.org/node/1494670 - and it is done by Wim Leers and I guess it is because of the caching issue to.
    – Jonasdk
    Feb 2, 2016 at 10:24
  • We use fastly too, I don't know our exact setup (we use platform.sh) but I know that drupal sees the same/public domain for incoming requests. Yes that issue was about caching but it was mostly about caching with http/https.
    – Berdir
    Feb 2, 2016 at 10:42

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.