通过apache Web服务器提供的IE11浏览器中未加载JPEG图像 [英] JPEG Images not loading in IE11 browser served through apache web server

查看:249
本文介绍了通过apache Web服务器提供的IE11浏览器中未加载JPEG图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用apacher Web服务器将静态内容(例如图像,css等)分散到我的网站中.下面是我的Apache配置集:

I'm using apacher web server to stre the static content (like images, css etc.) with my website. Below is my apache configurations set :

<IfModule mod_expires.c>
  ExpiresActive on
   <FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|html)$">
        ExpiresActive On
        ExpiresDefault "access plus 30 minutes"
   </FilesMatch>
</IfModule>

<IfModule mod_headers.c>
  <FilesMatch ".+\.(ico|jpg|jpeg|png|gif|js|css|swf|html|woff)$">
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Content-Type-Options nosniff
  </FilesMatch>
</IfModule>

请注意,对于相同的jpeg图像,相同的apache配置在测试区域中有效,而在生产区域中则无效.

Please note that the same apache configuration is working in test region, but not working in prod region for same jpeg images.

该缓存适用于woff,css,js,png文件,但不适用于我的几个jpeg图像,这些图像是从网站屏幕之一的特定文件夹中加载的.知道为什么吗?

The cache works well for woff,css, js,png files, but doesnt work for my few jpeg images which are loaded from specific folder for one of the website screen. Any idea why?

推荐答案

我认为该问题与缓存有关. 304 Not Modified表示它将加载缓存.它指示自上次传输以来未修改请求的资源,因此不需要将请求的资源重新传输给客户端.您可以尝试Ctrl+F5在IE中进行强制刷新,以查看图片是否显示.

I think the issue is related with cache. 304 Not Modified means it loads the cache. It indicates that the requested resource has not been modified since the previous transmission, so there is no need to retransmit the requested resource to the client. You could try Ctrl+F5 to hard refresh in IE to see if the picture shows.

这篇文章中,它说 the mod_cache模块是在Apache中产生意外的 304 代码的最可能元凶.因此,您可以在配置文件中打开查找mod_cache.c文件的部分.您可以参考官方示例配置.

In this article, it says that the mod_cache module is the most likely culprit for producing unexpected 304 codes in Apache. Thus, within the configuration file you have open look for a section that checks for the mod_cache.c file. You could refer to the official sample configuration.

找到此配置后,您可以尝试通过在要注释掉的每一行的开头添加#字符来注释掉缓存部分(但不要删除任何内容).然后保存修改后的配置文件,然后重新启动Apache Web服务器以查看是否解决了问题.

After finding this configuration, you could try to comment out the caching section by adding # characters at the start of every line to be commented out (but don't delete anything). Then save the modified configuration file then restart the Apache web server to see if this fixed the problem.

这篇关于通过apache Web服务器提供的IE11浏览器中未加载JPEG图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆