HubSpot-Developer-Extension
HubSpot-Developer-Extension copied to clipboard
Page Speed scores can only be generated once.
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
The jQuery footer use case is a really good point here. Agreed on this idea
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 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.
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.