3

We have a single-page app that uses pushState to change the URL in the browser. The app entry point - index.html downloaded each time no matter what the actual URL is - has it's <base> tag with href attribute set to some fixed URL (e.g. /myapp) as a context for a Tomcat server.

The problem is that we want to use HTML5's Cache Manifest that seems not to use the <base> href attribute when looking for the manifest file. For example:

When accessing the app through the following URL:

http://localhost:8080/myapp/view/detail

with index.html having:

<html manifest="app.manifest">
    ...
    <base href="/myapp">

then browser looks relatively to the current browser URL (myapp/view/detail) and not the base href path.

When manifest is specified as an absolute path:

<html manifest="/app.manifest">

then it looks for the file in the root (localhost:8080/).

But we need it to be resolved to /myapp/app.manifest (for portability reasons, we don't want to specify the server host/port in any of the URLs)

What are we doing wrong?

redhead
  • 1,264
  • 1
  • 17
  • 32

0 Answers0