即使文件已在服务器上更改,如何在浏览器上显示相同的文件?

发布于 2024-12-07 06:33:25 字数 172 浏览 4 评论 0原文

我正在服务器上上传一个文件(图像),并使用一个唯一的名称保存它。现在在从服务器获取文件的浏览器上预览它。

现在,我更改了文件(图像),但仅使用以前的唯一名称保存。但是,在预览时,浏览器显示以前的文件。

我发现这是一个cookie问题。因此,在手动从浏览器中删除 cookie 后,我能够看到新文件。

I am uploading a file(Image) on the server, and saving it with one unique name. Now previewing it on the browser where file fetched from the server.

Now, I changed the file(image), but save with that previous unique name only. But, while previewing it, browser is showing previous file.

I figured it out as a cookie problem. So after deleting cookie from the browser manually, I were able to see the new file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

思慕 2024-12-14 06:33:25

这是一个缓存问题,而不是cookie。当您清除 cookie 时,您可能也清除了浏览器缓存,因此出现了新图像。

您可能需要检查服务器配置以缓存过期标头。

如果您不知道如何更改它(我无法向您展示如何更改,因为这取决于您的服务器环境),在浏览器上按 Ctrl + F5 执行无缓存刷新可能会有所帮助您会立即看到您的新图像。

It is a caching issue, not cookie. You might have cleared your browser cache as well when you cleared your cookie, so the new image appeared.

You might want to check your server configuration for caching expiration header.

If you don't know how to change it (I can't show you how because it depends on your server environment), pressing Ctrl + F5 on your browser to perform a no-cache refresh might help you see your new image right away.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文