简体   繁体   English

Drupal 8 上的缓存图像

[英]Cached Images on Drupal 8

We have a website in Drupal 8 where we are using images and we have different sort of implementation, ranging from custom modules and direct content type and image fields.我们在 Drupal 8 中有一个网站,我们在其中使用图像,并且我们有不同类型的实现,从自定义模块到直接内容类型和图像字段。

The issue is when we replace an image with a new one, whether changing name or image itself, it doesn't reflect on the end user's browser.问题是当我们用新图像替换图像时,无论是更改名称还是图像本身,它都不会反映在最终用户的浏览器上。 We clear the Drupal 8 cache after pushing changes, but still, the same issue persists.我们在推送更改后清除了 Drupal 8 缓存,但同样的问题仍然存在。 However, when the user tries in incognito, a new image or name is reflected.但是,当用户尝试隐身时,会反映新的图像或名称。

We are not using CDN.我们没有使用 CDN。 Please help us out with how to fix this.请帮助我们解决此问题。

Thanks谢谢

I believe it is because the page is cached in user's browser.我相信这是因为页面缓存在用户的浏览器中。

  1. Prevent caching of images (Not recommended if there are many images in the site)防止图像缓存(如果站点中有很多图像,不推荐)
  2. Clearing user's browser cache清除用户浏览器缓存
  3. Adding a randon query string to the page URL向页面 URL 添加随机查询字符串

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM