HubSpot-Developer-Extension icon indicating copy to clipboard operation
HubSpot-Developer-Extension copied to clipboard

Page Speed scores can only be generated once.

Open TheWebTech opened this issue 7 years ago • 4 comments

Describe the bug if you view a page and go to use the page speed feature, the score persists if you go to a new URL and reopen the extension. Preventing you from being able to see the before and after of the "move jquery to footer" functionality.

Expected behavior clicking again should retest the current URL

TheWebTech avatar Jun 21 '18 15:06 TheWebTech

The jQuery footer use case is a really good point here. Agreed on this idea

williamspiro avatar Jun 21 '18 15:06 williamspiro

I'll be honest I'm not sure why your PageSpeed function can't be run again. It looks like it should be able to.

TheWebTech avatar Jul 01 '18 14:07 TheWebTech

@TheWebTech this actually is happening. PSI heavily caches this data which is why it may not seem so, however, we could add something like $('.c-btn__score').remove(); to the start of the getPsiData so it is easier to tell we are trying again, however, the response is almost instantaneous if you grade the same url, given google caches these results.

williamspiro avatar Jul 02 '18 19:07 williamspiro

Yea I think you're right about the caching, unfortunately it doesn't seem to treat the URLs with query parameters as if they're different URLs.

Maybe we have to do a check and see if the results are the same, and if they are the same display a notice "Google Page Speed results are cached for X minutes" and link to the Google Page speed site or something.

Actually that brings up a good point, if parameters are not treated as separate URLs does it even ping the URL WITH the parameter. so If you were trying to test the jQuery in the footer, does it actually test with the parameter or just the straight URL, defeating the purpose of the test.

TheWebTech avatar Jul 02 '18 19:07 TheWebTech