Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7628215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:33:55+00:00 2026-05-31T05:33:55+00:00

I am developing a web app in which I am trying to use the

  • 0

I am developing a web app in which I am trying to use the HTML5 application cache.

I can successfully cache the files and load the files from AppCache while online. But when I go offline, all the css and js files are transferred with MIME type text/html instead of application/x-javascript or text/css, so it is not properly working on offline.

This is what I get when I request a page while offline.

Application Cache Error event: Manifest fetch failed (-1) https://example.com/manifest
Resource interpreted as Stylesheet but transferred with MIME type text/html: "https://example.com/offline_assets/stylesheets/cache/offline_all.css".
Resource interpreted as Script but transferred with MIME type text/html: "https://example.com/javascripts/offline/respond.min.js".
Resource interpreted as Script but transferred with MIME type text/html: "https://example.com/javascripts/yui3/3.1.1/build/yui/yui-min.js".
Resource interpreted as Script but transferred with MIME type text/html: "https://example.com/offline_assets/sprockets.js".

Therefore, the page is not styled and getting whole kind of JS errors.

How can I properly set such that css and js files are transferred with a proper MIME type from appcache while offline?
thank you for your suggestions

Updated:
this is how I serve the manifest file on the server

class ManifestController < ApplicationController

  def show
    headers['Content-Type'] = 'text/cache-manifest'
    render :text => File.open("#{RAILS_ROOT}/public/manifest.appcache").read, :layout => false
  end
end

and I have passed this validation test:
http://manifest-validator.com/

Here is my Manifest file:

CACHE MANIFEST
#<
/offline_assets/stylesheets/cache/offline_all.css
/offline_assets/fonts/websymbols-regular-webfont.woff
/offline_assets/javascripts/yui3/3.1.1/build/yui/yui-min.js
/offline_assets/sprockets.js
/offline_assets/javascripts/offline/respond.min.js
/offline_assets/images/logoClio.png
/offline_assets/images/search/icoSearch.png
/offline_assets/images/icoArrow-down.png
/offline_assets/images/gold/submenu_current.png
/offline_assets/images/calendar/left_arrow.gif
/offline_assets/images/calendar/right_arrow.gif
/offline_assets/images/calendar/left_arrow_on.gif
/offline_assets/images/calendar/right_arrow_on.gif
/offline_assets/images/calendar-lg.gif
/offline_assets/images/logo-tagline.gif
/offline_assets/images/icoRecent-matter.png
/offline_assets/images/icoRecent-contact.png
/offline_assets/stylesheets/yui/dt-arrow-dn.png
/offline_assets/stylesheets/cache/sprite.png
/offline_assets/images/timer_stop.png
/offline_assets/images/add3.png
/offline_assets/images/arrow_down.gif
/offline_assets/images/spinner.gif
/offline_assets/images/timer_start.png
/offline_assets/images/delete.png
/offline_assets/images/offline/logoClio.png
/offline_assets/images/offline/bgSteps-1.png
/offline_assets/images/offline/bgSteps-2.png
/offline_assets/images/offline/bgSteps-3.png
/offline_assets/images/offline/icoReload.png
/offline_assets/images/offline/dt-arrow-dn.png
/offline_assets/images/offline/sprite.png
#>

# offline.html will be displayed if the user is offline and attempt to get uncached pages
FALLBACK:
/ /offline.html

# All other resources (e.g. sites) require the user to be online. 
NETWORK:
*

And this is one of the cached file that shows MIME type and other details on chrome://appcache-internals/

https://staging.goclio.com/offline_assets/sprockets.js?cec750eb3581f3d9f78c97d0ad8331df
HTTP/1.1 200 OK
Server: nginx/0.8.55
Date: Fri, 09 Mar 2012 19:56:17 GMT
Content-Type: application/x-javascript
Last-Modified: Fri, 09 Mar 2012 19:51:10 GMT
Expires: Thu, 31 Dec 2037 23:55:55 GMT
Cache-Control: max-age=315360000
X-Backend-Server: 333963-web02.rs.goclio.com:81
Accept-Ranges: bytes
Vary: Accept-Encoding, User-Agent
Content-Encoding: gzip

Another update: this works fine on firefox without getting any MIME type error.
Naoya

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:33:55+00:00Added an answer on May 31, 2026 at 5:33 am

    It was actually not an issue of MIME type. It was giving me the text/html content-type error as it was returning offline.html which is returned when I request a non-cached file.
    The issue was that I added MD5 hash as a parameter for each file. so the manifest looked like this.

    CACHE MANIFEST
    /offline_assets/stylesheets/cache/offline_all.css?someMD5hash
    /offline_assets/javascripts/yui3/3.1.1/build/yui/yui-min.jsf?anotherMD5hash
    #and may more files with MD5 hash
    
    FALLBACK:
    / /offline.html
    
    NETWORK:
    *
    

    when it requested the content while offline, it was not able to find an appropriate file as the cached file name contained the MD5 hash as a parameter.
    So I resolved it by including the MD5 hash as the comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a web app for which I plan to use InnoDB. However
I am developing web app using asp.net. I have plenty of javascript files which
I am developing a web app in which I remove all elements from a
We are developing a web app ( http://beta.dammela.it ) which use both FB Graph
I am developing a web app which requires a username and password to be
I'm developing a web app for which the client wants us to query their
I'm developing web app that user can save his/her work to server. The data
we're developing a web app to cover all aspects of a printing company from
I am developing a play web application which is supposed to be deployed on
I'm developing a QA web-app which will have some points to evaluated assigned to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.