Repository: next.js
Issue: Temporary Redirect not revalidating again
Labels: bug

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 20.5.0: Sat May  8 05:10:33 PDT 2021; root:xnu-7195.121.3~9/RELEASE_X86_64
    Binaries:
      Node: 14.17.1
      npm: 6.14.13
      Yarn: 1.22.11
      pnpm: N/A
    Relevant packages:
      next: 12.2.6-canary.4
      eslint-config-next: N/A
      react: 18.2.0
      react-dom: 18.2.0


### What browser are you using? (if relevant)

104.0.5112.101 (Official Build) (x86_64)

### How are you deploying your application? (if relevant)

next start

### Describe the Bug


article page url in my application is 

`/article/123-abc`

123 --> article id
abc --> article headline

both id and headline of article joined by **-** to form the url of the article.

**My use case:**

The article headline is changed from **abc** to **ddd** in CMS, so the new url is now `/article/123-ddd`

Now if the user hit the url like `http://localhost:3000/article/123-abc`, the user will be redirected to `http://localhost:3000/article/123-ddd` with `permanent:false` in redirect options from getStaticProps Function

Now, In the article listing page(`http://localhost:3000`), the url is updated as `/article/123-ddd` but on the article detail page, the API is still returning the same old headline "abc" (assume both apis are independent i.e different cache time).

Now, if the user hits the article page `/article/123-ddd`, the user is redirected to `/article/123-abc` as the article detail api is not updated to the new headline value.

when I investigate this redirection is happening through this JSON file `/_next/data/OuN8HR3cxh9Ir0OKP8Xib/article/123-ddd.json?slug=123-abc`

that json file is having cache time (shared cache time) as 31536000 sec(=== one year). see screenshot of article listing page

**Redirection 307 as article listing page eagerly gets the data for the links in the article listing page (see below)**

<img width="1788" alt="Screenshot 2022-08-24 at 17 35 59" src="https://user-images.githubusercontent.com/4039657/186438666-dfc044c2-e154-4173-8d6a-8ca234eb96d5.png">

**cache time for redirection data is one year (see below)**

<img width="1792" alt="Screenshot 2022-08-24 at 17 36 11" src="https://user-images.githubusercontent.com/4039657/186438705-f1e13477-2999-4356-9ee5-cc387108e610.png">


After some time, API for article detail page is updated, reflecting the CMS change giving the  new headline "ddd"

now if the user accesses the article page `/article/123-ddd`, the user is redirected to `/article/123-abc` 

now article page `/article/123-abc` will redirect the user to `/article/123-ddd` because the headline is now "ddd"

but the `/article/123-ddd` is having a one-year cache , so it is again redirecting to `/article/123-abc` 

then this circular loop happens, there is no way to access the page `/article/ddd` thereafter

Even though I give permanent: false as redirect options, I am not seeing  getStaticProps called again for the updated url `/article/123-ddd`

When I mention this redirection is not permanent, nextjs should run the getStaticProps after some time to check whether this redirection is still valid, 

But unfortunately, it is taking cache as one year.

When I use manually hit the revalidate API with the token, the cache is cleared for the `/article/123-ddd`

I tried giving revalidate options in the redirect object, no use.




### Expected Behavior

Nextjs should run the getStaticProps for the redirect with permanent false,



### Link to reproduction

https://stackblitz.com/github/shmdhussain/temp_redirect_revalidation_iisue_nextjs

### To Reproduce

## STEPS TO REPRODUCE:

1. clone the repo https://github.com/shmdhussain/temp_redirect_revalidation_iisue_nextjs or clone my stackblitz  demo https://stackblitz.com/github/shmdhussain/temp_redirect_revalidation_iisue_nextjs

1. run `npm i`

1. run `npm run build`

1. run `npm run start`

1. I used port 8082(for demo)

1. go to http://localhost:8082

1. then open the dev tool and refresh the page and see in devtool the request to fetch the data for the `/article/123-abc` is there, you can see this by giving the  filter value as  "/article" in dev tools network tab filter

1. then go to the project folder and go to `dummy_data/article/list.json` (why changing is , I am trying to simulate the API response through filesystem) and change the headline to "ddd" from "abc", wait for 10 sec(I gave revalidate time as 10 sec)

1. then go to the browser and refresh the http://localhost:8082, you will see the headline is updated as "Article ddd"

1. now in devtool you can see the request to `/article/123-ddd`, giving the redirect data cached for one year.

1. Then go to `dummy_data/article/123.json` and change the headline from "abc" to "ddd", wait for 10 sec (I gave revalidate time as 10 sec)

1. then go to the browser and refresh the http://localhost:8082, click the "Article ddd" link and you see the circular loop happens, you cannot access the updated article page