I’ve noticed that default_pagination filter now renders a new parameter called phcursor in the pagination links.
Previously, the links looked like this: /collections/all?page=3
But now they are rendered like this: /collections/all?page=3&phcursor=eyJhbGciOiJIUzI1NiJ9.eyJzayI6InByb2R1Y3RfdGl0bGUiLCJzdiI6IkJyb3duIFRocm93IFBpbGxvd3MiLCJkIjoiZiIsInVpZCI6ODA1OTcxODAwODk5NCwibCI6MTYsIm8iOjAsInIiOiJDUCIsInYiOjF9.FxfPCkZ_IDJGkU2ZgS434tlCWAb73OaOXyfKX2QiGRQ
I haven’t been able to find any documentation about this new parameter. Could someone clarify what it’s for?
I’m also a bit concerned that manually rendering pagination links without this parameter (instead of using default_pagination) might eventually cause issues.
This new change has caused a few clients of mine issues who utilize this Library for infinite scrolling
I fixed it in the meantime by just splitting the phcursor off of the pagination next url
However, I am in the same boat as Anton, bit worried this may cause further issues down the road, so for now just wrapped it in a theme setting temporarily, so more information from Shopify would be helpful!
Like @FireNet_Designs, this new parameter broke an infinite scroll feature on a client store, which was also incredibly weird to debug until I noticed this phcursor was new.
I’ve found no information about this new parameter other than this forum post.
Hi Liam,
in case you haven’t stumbled upon it yet, please keep in mind that SEO tools will flag as an issue the fact that the URL in rel=“next” (in header) is not found as an anchor in the page, due to the phcursor param missing in the rel=“next” url.
I also got my client raise issue on the infinitely scroll plugin. And also not found Shopify announce any of this. This issue reported since Jun 21 and it has been 14+ days, no info from Shopify about this…
What I notice the new param exists on pre and next page, not any page beyond, e.g. for a collection with 12 pages, and if I reach page 5, the pagination on page 5, it has such param on Page 4 & 6.
phcursor seems implies some meaning about collection pointer, something like Page Head Cursor, it should be for performance boost, the param seems optional because with the same example, links beyond the prev/next page also has no such param, I’d say it is currently safe to skip the param, or the plugin Infinite Scroll shall need to update in order to support ignoring certain params. More sharing from me here.
I believe the fix was for the issue with infinite scroll that some themes were experiencing. Checking if we changed how pagination works with this parameter.
Thank you for your response. There isn’t actually a bug on my site, but the phcursor link looks out of place on my pagination pages. Are you planning to disable that again?
There is a problem related with SEO if we keep this paremeter on pagination.
What is the purpose of this parameter? Is there any problem if we decide to remove it?
Just to add some color on the why: the phcursor parameter makes it about 2x faster for Shopify to fetch the data necessary to render subsequent pages of your collection.
Technical explanation: Before, we had to use offset-based pagination for our database queries as that’s all the information we have: ?page=3 → OFFSET 150 with 50 products per page. However, offsets become extremely inefficient very quickly, as they force the database to scan through all the rows before the one you’re offsetting from. That means pages past the first hundred results started getting slower and slower.
The phcursor parameter allows us to do cursor-based pagination. We go from ?phcursor=asdf123 → WHERE value > asdf123 in the database query, which is significantly faster, especially as you have more pages.
Regarding SEO: we do not show this parameter to requests coming from web crawlers. That means your SEO is not impacted by this parameter at all.
Correct, links without the phcursor will continue to work! They’re less performant, therefore buyers will get the phcursor links, but crawlers will get the page links to not mess with SEO.