« Previous Next »

Thread: Warning "The content type for the resource is incorrect."

Last post 11-02-2009 1:13 PM by CarlosAg. 5 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (6 items)

Sort Posts:

  • 10-26-2009, 12:23 PM

    • EricSch
    • Not Ranked
    • Joined on 05-29-2006, 2:14 PM
    • Posts 6

    Warning "The content type for the resource is incorrect."

    I got this warning:

    The content type "application/x-javascript" does not match the content type of the HTTP response from URL "http://www.fff.ch/Content/jquery.cookie.js". Recommended content type: "application/javascript".

    But by definition, this means only that the resource is compressed (Gzip).

    It don't think this should be a warning.

    Thanks

    Eric

  • 10-27-2009, 1:32 PM In reply to

    Re: Warning "The content type for the resource is incorrect."

    The violation is trying to tell that the "standard" content type for javascript is application/javascript. unfortunatley the default configuration today returns application/x-javascript.

    If you were interested into changing it you need to be careful in updating two pieces of configuration, the httpCompression section and the staticContent section.

    staticContent is the one that dictates which content type is sent back, but it is important to update the httpCompression to make sure that compression continues to work for static and dynamic scripts.

  • 10-27-2009, 2:54 PM In reply to

    • EricSch
    • Not Ranked
    • Joined on 05-29-2006, 2:14 PM
    • Posts 6

    Re: Warning "The content type for the resource is incorrect."

    Thanks for answering.

    If you look up the internet, it seems that this is a valid content-type:

    GZIP + application/javascript -> application/x-javascript.

    What's correct now?

    Is it a valid content-type or not?

    Should it be used for this purpose?

    BTW: My hoster returns this header.

  • 10-27-2009, 4:01 PM In reply to

    Re: Warning "The content type for the resource is incorrect."

    Do you have a pointer to where you found that information, I am very curious if that is a true statement, or just what people might have infered by the fact IIS sends this by default.

  • 10-27-2009, 4:42 PM In reply to

    • EricSch
    • Not Ranked
    • Joined on 05-29-2006, 2:14 PM
    • Posts 6

    Re: Warning "The content type for the resource is incorrect."

    I have a pointer where it says that you should use 'application/javascript' (RFC). It's from 2006, but nobody cares.

    If I bing for 'application/x-javascript' and 'gzip', you find also many references for this case, but nothing official. It's used by IIS and Apache.

     So I'm also confused. And my ISP hoster tells my, that 'application/x-javascript' is "common use"

  • 11-02-2009, 1:13 PM In reply to

    Re: Warning "The content type for the resource is incorrect."

    Indeed application/x-javascript is of common use. For the next version of SEO Toolkit (v1.0 RTW) we will remove this warning since it really is not a critical warning and the defaults of current Web Servers will cause this very commonly.

Page 1 of 1 (6 items)
Microsoft Communities