Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Add application/javascript to gzip_types

valmont's Avatar

valmont

03 Jun, 2017 06:04 AM

Currently, I believe, application/javascript is not included in the default types for the static gzip settings. Can you add it?

Thanks.

  1. Support Staff 1 Posted by rune on 07 Jun, 2017 03:06 AM

    rune's Avatar

    Hi,

    Apologies for the slow response. You're right -- application/javascript is not current a default gzip type on the platform. The currently supported gzip types are:

    text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript
    

    The gzip types isn't configurable per-application on the shared load balancers, but it might be time to reevaluate the inclusion of application/javascript considering text/javascript is now considered "obsolete" -- should still work though, so using that type instead may be a reasonable workaround for the time being?

    Best,
    Rune

  2. 2 Posted by valmont on 07 Jun, 2017 03:09 PM

    valmont's Avatar

    Hi, Rune.

    Even though I have specified type="text/javascript", the response headers still show a content type of application/javascript.

    Any chance this can get added to the the core configuration?

  3. 3 Posted by valmont on 07 Jun, 2017 03:22 PM

    valmont's Avatar

    Decided to make an IHttpModule to explicitly set the content type. Let me know when/if the conig is updated.

  4. Support Staff 4 Posted by rune on 09 Jun, 2017 01:21 AM

    rune's Avatar

    Hi,

    Ok so another approach might be to just instruct the static file handler to set the content type for static content. I haven't tested this, but I'm pretty sure this would do the trick:

    <configuration>
        <system.webServer>
            <staticContent>
                <remove fileExtension=".js" />
                <mimeMap fileExtension=".js" mimeType=“text/javascript” />
            </staticContent>
        </system.webServer>
    </configuration>
    

    I'll let you know when the gzip configuration is updated -- the load balancers have a couple of updates scheduled for later this month, so hopefully it'll be possible to have this evaluated and tested before then. Adding the gzip type is very straightforward, but could potentially cause issues for other apps using the shared load balancers, so we have to take greater care when making these types of changes!

    Best,
    Rune

  5. rune closed this discussion on 09 Jun, 2017 01:21 AM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac