Tuesday, 8 May 2007

A very long waited feature: paging!

Finally, after probably over a year of planning, I had to modify the section of Prezzi Benzina where all the prices were displayed.
This was necessary because some gas stations now have too many prices:
  1. 2818: 1982 prices
  2. 3321: 1672 prices
  3. 3704: 1538 prices
It was taking too long for each page to load, making the people trying to fetch the page again and again, causing the server to be overloaded.

The only way of fixing it was to breaking down the prices in different pages. With MySQL it's very easy to do it by using the LIMIT and the OFFSET keywords.

Tomorrow I must remember to test if the server load will be lower.

No comments: