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 7178133
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:51:34+00:00 2026-05-28T16:51:34+00:00

I’m using an HTML5 manifest to allow an application to work offline. I have

  • 0

I’m using an HTML5 manifest to allow an application to work offline. I have a resource — say /background.png — that may update from time to time, but if the application is offline, the last-retrieved version is suitable for use. The behavior I want is for the browser to request /background.png normally if it’s online, but to fall back to the cached version if the request fails because it’s offline, the server is down, etc.

In my testing, having a manifest entry like

NETWORK:
/background.png

made the browser always try to request the resource. It would return an error, rather than returning a copy from the appcache, if it was offline. That’s not what I want, but it is how NETWORK is supposed to behave as I understand it.

I also tried

FALLBACK:
/background.png /background.png

hoping that might mean “fall back to the cache copy if you can’t get a new one”, but in that configuration the browser doesn’t try to request the resource if it’s online.

Another possibility I considered was

CACHE:
/offline-background.png

FALLBACK:
/background.png /offline-background.png

but having two different names for the same resource — and having the same resource requested twice (once for the img src=”background.png” and once for the cached offline copy) — seemed like an unattractive hack.

I could also make an arbitrary change to the manifest when background.png changes, but that would cause the browser to check everything in the manifest.

Is it possible to get this “use what I have unless I can get a new one” pattern from an HTML5 manifest? This seems like a reasonable pattern, so I’d think there’d be a clean way to do it. If not, can anyone suggest another approach? Thanks in advance!

EDIT: The original question referred to “news.json”, implying that the resource was being retrieved by JavaScript, but I’ve changed it to “background.png” to make it clearer that I’d like to do this with any resource used by a page.

  • 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-28T16:51:34+00:00Added an answer on May 28, 2026 at 4:51 pm

    The best way to manage the caching yourself is to stick it into local storage. You should be able to simply drop the JSON from your news feed straight into a single variable. When you request the /news.json file only update the cached copy of it on a 200 response, in the rest of your app always use the copy in local storage.

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.