6

I am using mod_pagespeed. When using http, combine js, css and rewrite js and css work fine. However, when I switch to https, none of these four functions work. The apache error log is empty about this.

This is the relevant conf line ModPagespeedEnableFilters rewrite_javascript,rewrite_css,combine_css,combine_javascript,insert_dns_prefetch

Nish
  • 130
  • 1
  • 2
  • 6

1 Answers1

7

mod_pagespeed cannot rewrite HTTPS resources by default, you have to explicitly enable it by one of these options:

  1. ModPagespeedMapOriginDomain - to tell mod_pagespeed to fetch HTTPS resources using HTTP
  2. ModPagespeedLoadFromFile - to tell mod_pagespeed to load HTTPS resources directly from the filesystem.
  3. ModPagespeedFetchHttps - to tell mod_pagespeed to fetch HTTPS resources directly.
  4. ModPagespeedFetchFromModSpdy - if you have mod_spdy installed, to fetch resources using it.

The documentation has more details: https://developers.google.com/speed/pagespeed/module/https_support

sligocki
  • 6,246
  • 5
  • 38
  • 47
  • 2
    This answer seems not be up-to-date: "As of version 1.10 HTTPS fetching (FetchHttps) is enabled by default, and PageSpeed no longer requires additional configuration to fetch and optimize resources over https. The alternatives described below, however, are more efficient in situations where they apply." https://www.modpagespeed.com/doc/https_support regards, Andreas – Andreas Dec 13 '17 at 14:00