1

How I can disable favicon.ico in specific jsp page so there wouldn't be any traffic?

Thanks in advance.

Jordan Borisov
  • 1,603
  • 6
  • 34
  • 69

2 Answers2

1

When the physical favicon.ico file is placed in the webapp's root folder, then most browsers will automatically use it, regardless of whether you explicitly specify it in a <link> or not. If you change this by moving the favicon file into some folder and using the <link> element to reference it as follows,

<link rel="shortcut icon" href="${pageContext.request.contextPath}/somefolder/favicon.ico" />

or even rename the file to something else than the standard favicon.ico,

<link rel="shortcut icon" href="${pageContext.request.contextPath}/logo-16x16.png" />

then you could for the particular JSP page just remove/skip the whole <link> altogether.

Don't forget to clear the browser cache before testing. Browsers cache it very agressively.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
0

It's impossible because you can't prevent browser from requesting it. Quoted from Yahoo!

The favicon.ico is an image that stays in the root of your server. It's a necessary evil because even if you don't care about it the browser will still request it

So all you can do is to make that image as small as possible and set expires header with what you feel comfortable.

You can take a look at this SO question for more information.

Community
  • 1
  • 1
Eli
  • 14,779
  • 5
  • 59
  • 77