Artix Linux Forum

General Category => Off-Topic => Topic started by: xyxy on 08 March 2020, 18:29:12

Title: redirect after GET request as part of the website backend ?
Post by: xyxy on 08 March 2020, 18:29:12
Hello,

I just had the idea to use redirects in server side code of a website to reduce SQL-queries, but I am not sure if it's a good idea:

Usually, I have always had 3 queries for a single photo page, like for example `/photos/5`.
One for the "photo 5", and 2 for the "previous photo" and "next photo" links.

The idea is now to make only 1 query for "photo 5" and then create links in the form `/photo/5/prev` and `/photo/5/next`, and the server  will then redirect to `/photos/4` or `/photos/6` (or what is previous and next).

I suppose this is somehow bad design or not good for SEO, but I don't know why. Should I not try it, and why not? Or would it be no problem?

thanks.