font awesome icon is not appearing in IE 11, but showing in other browsers

前端 未结 16 1448
孤城傲影
孤城傲影 2020-12-01 06:40

I am new to font-awesome icons. I have one page in which there is a filter where user can search the data. I have added font awesome icon just before the search link (as per

16条回答
  •  一个人的身影
    2020-12-01 07:22

    We recently had this issue serving Font Awesome font files from our Rails application. The confusion was that we weren't passing Pragma or Cache-control response headers - so the previous answers in this post were a bit confusing.

    To summarize - this issue is caused by these two conditions:

    1. The request is being initiated from font-face, over an HTTPS connection (critical for re-producing this bug locally).
    2. The Pragma header has the value no-cache OR in our case, we're serving everything gzipped, and the Vary header is passed with a value other than Accept-Encoding.

    We fixed this by adding the following to our Rack::CORS config:

    config.middleware.insert_before 0, Rack::Cors do
          allow do
            origins '*'
    
            # Setting Vary to Accept-Encoding required or IE11 fonts will not load from local cache
            resource('*.eot',
                     headers: :any,
                     credentials: false,
                     methods: [:get],
                     vary: ['Accept-Encoding'])
          end
        end
    

提交回复
热议问题