301 Redirect Issue

Hello!

So I am trying to load test a webpage (on k6 cloud), and I noticed that half the requests are generating a 200 response code, and the other half a 301 response code. I have two questions regarding this…

  1. Why is this happening?
  2. How does it affect the average response time metric?

Sorry for the basic question, I’m fairly new to this :slight_smile:

Hi @vish, welcome to the forum :tada:

301 literally means that you were redirected, common reasons why are: lack of “www.” in front or “/” at the end … or w/e else was configured on the server you use. This can also be after a POST request or something like that.

This is usually easy to spot looking at the URLs (and methods) in the web UI.

I don’t know about the average as that depends on whether there is a difference between the response time for the 301 and the 200 - if there isn’t - there is no difference ;). But you are making one more request than needed if all it is happening is that you are being redirected from www.example.com to www.example.com/ or something like that.

Hope this clears things up

It was the “www.” Thanks a lot!!