最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Firefox caching Iframe content - Stack Overflow

programmeradmin7浏览0评论

No matter what I do Firefox and Chrome (not Safari) are caching the contents and cookies of iFrames.

I have tried all the suggestions from: Preventing iframe caching in browser

And consulted ChatGPT which suggests:

<IfModule mod_headers.c>
    Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

Or similar in the meta tags, or adding a dynamic variable to the src URL.

It just seems impossible to stop it loading a cache version, which is a problem as when a user returns to my site even if they login Firefox remembers the state from the first visit (and they have to login again).

Note the problem only occurs if the user links from the same domain as the first visit.

No matter what I do Firefox and Chrome (not Safari) are caching the contents and cookies of iFrames.

I have tried all the suggestions from: Preventing iframe caching in browser

And consulted ChatGPT which suggests:

<IfModule mod_headers.c>
    Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

Or similar in the meta tags, or adding a dynamic variable to the src URL.

It just seems impossible to stop it loading a cache version, which is a problem as when a user returns to my site even if they login Firefox remembers the state from the first visit (and they have to login again).

Note the problem only occurs if the user links from the same domain as the first visit.

Share Improve this question edited Mar 17 at 16:15 Guesser asked Mar 17 at 16:10 GuesserGuesser 1,8574 gold badges27 silver badges56 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

So...

<IfModule mod_headers.c>
    Header set Cache-Control "no-store, no-cache, must-revalidate, max-age=0"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

...does work but you have to empty the browsers cache or it saves the previous cache settings!

发布评论

评论列表(0)

  1. 暂无评论