change path of pagespeed generated URL!

14 views
Skip to first unread message

Saumin Patel

unread,
Jun 13, 2019, 5:33:25 PM6/13/19
to Support, rusty...@broadridge.com
Hi,
We are testing PageSpeed on one of our applications. This application is a coldfusion site hosted on IIS 7. At this point in IIS, it is designed in such a way that the UAT url adds the actual word "uat" to the end of prod URL. for example, www.mytestsite.com/uat, which is a uat site, and its corresponding prod site would be www.mytestsite.com. This change does not happen at IIS level, but within the application, where the paths are manipulated. Additionally, some resources are being referenced from prod site/network as well.
So, the issue that is happening is that when pagespeed generates its URLs to reference js, css, it actually generates prod urls but not uat urls. For example, it will create www.mytestsite.com/pagespeed_static/js_defer_xxxx.js, which will obviously fail. Instead it needs to create www.mytestsite.com/uat/pagespeed_static/js_defer_xxxx.js.
Because of these issues, some pages get 404 for certain resources, including pagespeed itself when it tries to reference certain resources.


How do we get around this issue?


Thanks!
Saumin

Otto van der Schaaf

unread,
Jun 13, 2019, 5:49:49 PM6/13/19
to Saumin Patel, Support, rusty...@broadridge.com
See https://www.modpagespeed.com/doc/configuration#pagespeed_static for how to change the path prefix of the module's static assets.
I hope that setting works, I'm not 100% sure we wired that feature up, and I cannot check right now, so please let me know.

Unrelated to the IIS module, and probably none of my business, but I am curious what the reasoning is behind using a subdirectory instead of, say, a different hostname to separate these environments. (because I suspect there are a few ways that this practice can lead up to trouble).

Otto

Saumin Patel

unread,
Jun 13, 2019, 5:56:11 PM6/13/19
to Support, saumin...@gmail.com, rusty...@broadridge.com
Thanks Otto! We will try it out and let you know.
As for the subdirectory, you are right. It just is a legacy design/"hack" that someone did to quickly get uat environment up.

Saumin Patel

unread,
Jun 13, 2019, 6:06:24 PM6/13/19
to Support, saumin...@gmail.com, rusty...@broadridge.com
On Thursday, June 13, 2019 at 5:49:49 PM UTC-4, Otto van der Schaaf wrote:
Unfortunately, by adding following line, it didnt work:
pagespeed StaticAssetPrefix /uat/

Any other ideas?

Saumin Patel

unread,
Jun 13, 2019, 6:07:23 PM6/13/19
to Support, saumin...@gmail.com, rusty...@broadridge.com
Unfortunately, by adding following line, it didnt work:
pagespeed StaticAssetPrefix /uat/

Any other ideas?

Otto van der Schaaf

unread,
Jun 13, 2019, 6:18:06 PM6/13/19
to Saumin Patel, Support, rusty...@broadridge.com
Hmm, that is unfortunate. If that feature doesn't work we need to fix it and produce a release.
I'm not sure what timeline we can offer for that, I suspect it will not be short notice.

One other short term workaround would be to put up a proxy which has a different hostname, routes to the original hostname,  rewrites the url paths and redirects to what acceptance expects.

Otto

Saumin Patel

unread,
Jun 13, 2019, 7:00:35 PM6/13/19
to Otto van der Schaaf, Support, rusty...@broadridge.com
Ok can you elaborate on the short term workaround?

Saumin Patel

unread,
Jun 14, 2019, 10:45:24 AM6/14/19
to Support, osc...@we-amp.com, rusty...@broadridge.com, saumin...@gmail.com
Otto,
Do you have time now? we can get on a call. Additionally, i wanted to mention again that we have URL Rewriter also setup as part of this applicatin. Do you think that it can be leveraged to achieve what we are looking to do?
Reply all
Reply to author
Forward
0 new messages