13

I see that in Magento 2 something changed in the way the page behaves when sorting a product list page or when the number of products visible per page is changed.
In Magento 1 there were parameters added to the url for sorting:

http://demo.magentocommerce.com/men/shirts.html?dir=asc&order=price
http://demo.magentocommerce.com/men/shirts.html?dir=asc&limit=24&order=price

but In magento 2 the sorting and page limit is changed via a POST request.
When I was a 'web development' student I learned that all filtering and sorting should be done via GET, for a better user experience.
This way the user can bookmark a list of 'things' already sorted, or share a link with the list filtered and sorted.

Any good reason why this is not used anymore in Magento 2? And is it worth sacrificing a bit of the customer experience for what ever reason that might be?

13
  • 2
    good remark, was wondering the same, I see no reason why they should use posts :| Commented Sep 9, 2014 at 8:18
  • For right cache handling?
    – Amasty
    Commented Sep 9, 2014 at 8:26
  • @Amasty. Can you explain a bit? Also feel free to add your explanation as an answer.
    – Marius
    Commented Sep 9, 2014 at 8:29
  • 1
    I think it would also mess up proxy level caching.
    – Paras Sood
    Commented Sep 9, 2014 at 9:29
  • 5
    I'm voting to close this question as off-topic because this is related to a pre release version of Magento, more info here: meta.magento.stackexchange.com/questions/907/… Commented Apr 20, 2016 at 8:57

2 Answers 2

1

Request arguments are cut to avoid possible DOS attacks. So filter modifications are made with POST.

But I really think that you should create a ticket on github to fix this.

3
  • Thanks Anton. I already added a ticket: github.com/magento/magento2/issues/656 . I really don't like this POST approach.
    – Marius
    Commented Sep 9, 2014 at 13:14
  • 1
    I think usability, and in this case, ability to SHARE the link is very important.
    – Amasty
    Commented Sep 9, 2014 at 14:20
  • Now it's back to post request :)
    – amitshree
    Commented Feb 11, 2016 at 18:46
0

I learned that all filtering and sorting should be done via GET, for a better user experience.

You learned wrong first of all. there is not relation with Get method to sorting for good performance. Post decrease the chances of hack.

1
  • 1
    I see your point. It's something similar to what Anton said. I guess I have to look up my "teacher" and show him this. On the other hand, you should always sanitize your queries to avoid hacks.
    – Marius
    Commented Sep 9, 2014 at 14:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.