Search code examples
pagespeedpagespeed-insights

Always Got Lower Performance Score with Encoded URL Parameter


Anyone can point me why google-page-speed api provides lower performance score with encoded url parameter?

I called api for 100 times with encoded url parameter versus unencoded url parameter, and the result as follow:

Encode URL parameter:

Normal URL parameter:

The other parameters are exactly the same.

Appreciate for you answering


Solution

  • The reason you get different results is that you actually end up testing two different URLs

    https://m.ctrip.com/webapp/flight/schedule/detail.html?hideAddTrip=true&isHideNavBar=YES&navBarStyle=gray&flightNo=NH7018&queryDate=2019-11-10&dcode=NRT&acode=LAX

    and

    https://m.ctrip.com/webapp/flight/schedule/detail.html?hideAddTrip=true

    By not URL encoding your request to PSI you are losing everything after the &.

    I am unsure why this is the case as I would have expected the opposite behaviour.