Edd Chang
Edd Chang

Reputation: 1013

follow-redirects behaving differently in production. Receiving etag

So I have a Node Express backend and I’m using the npm package: follow-redirects.

I follow a particular URL and due to data protected issues I cannot share it here.

But the gist is that when I follow the link’s redirects I have a certain number of steps that I go through and through each step I process information.

The problem is, this works fine locally in development and when I run it in production i.e. on a proper domain, the redirects craps out and I get a 404 status return with the following message.

{
  date: 'Wed, 28 Sep 2022 06:29:02 GMT',
  server: 'nginx',
  'content-type': 'text/html',
  'content-length': '250',
  vary: 'Accept-Encoding',
  etag: '"xxxxxxx-xx"', //obscured 
  connection: 'close'
}

Now I’ve tried looking it up and I found out that Etags are sent when the server has a cache of a similar request from a similar source. The problem is, I do not want that, and I cannot understand why it doesn’t reproduce in development. What am I missing here.

I’m sorry for the lack of information. I’ll be thankful for any bit of information regarding this problem.

FYI: Sometimes, it works, sometimes it doesn't on production. Is there a way to perhaps make sure the server I am sending a request to, thinks it is a new one and doesn't return an eTag?

Upvotes: 3

Views: 48

Answers (0)

Related Questions