html5 offline cache is caching all files instead of cached files that are listed - html5-appcache

I am trying to use offline caching of html5. But problem is it is caching all html files and not the ones I mentioned in cache manifest file:For ex: I have 4 html files: index.html, test.html, sample.html, fallback.html and I have sample.appcache manifest file that contains:
CACHE MANIFEST
index.html
sample.html
NETWORK:
test.html
FALLBACK:
/ /fallback.html
I dont have manifest="sample.appcache" attribute set in any html file. I am using JBoss 5 AS and in web.xml I added mime mappings as follows:
<mime-mapping>
<extension>appcache</extension>
<mime-type>text/cache-manifest</mime-type>
</mime-mapping>
So only index.html and sample.html needs to be cached offline but test.html is also getting cached if it was hit earlier when server was up. The fallback.html is not getting called when server is stopped in place of this test.htmlWhat is wrong with this setup?Second thing I did not understand is on IE(v9) and Firefox(v19) I don't have to set mime-mappings but for application to work on chrome(v26) and safari(v5.1.7) this setting is indeed mandatory.

I have not worked with JBoss, but the reason that Chrome and Safari want the MIME type for the appcache is because otherwise it has no way of identifying it as an cache manifest. Simple solution is to just include it :-P
As for the caching, where are you seeing it cached? Is it for sure being stored in the offline section? Keep in mind that files will still be cached like normal regardless of the cache manifest.

Related

How can I enable caching of HTML and CSS files on an Electron App?

I want to enable caching of certain or all HTML and CSS files on my Electron App. I've tried adding the following meta tag to my HTML files and it doesn't seem to do much of anything:
<meta http-equiv="cache-control" content="public/private">
(** I used "public/private" to indicate I've tried both values separately)
I'm simply wondering if Electron has a built-in method for caching files or if the meta tags should be working. I tried searching for cache documentation on Electron's Website to no avail.
I read somewhere that caching is enabled by default on Electron but it doesn't appear to be working too well.
Thank you.
Looks like the session module in Main is how to definitively enable it.
session.fromPartition(partition[, options])
- partition String
- options Object (optional)
-cache Boolean - Whether to enable cache.
https://github.com/electron/electron/blob/eed72c35d74947853ed75dd10e85d5ed56c1ce86/docs/api/session.md#sessionfrompartitionpartition-options

How to make Browser load css and js file from cache?

My MVC website is too slow because the browser always reload all css and js files from the server instead of using cache. So how can I do that?
My slow website:
My faster website:
Update 1: I found these settings in the HttpResponse, how can I remove it?

Azure Changes not getting published

I have made changes to my css on my MVC5 project that are working as intended on my local version but when I deploy to Azure the changes are not working.
I have tried creating a min.css file but this did not work
Have you done a hard refresh and pulled a copy of the stylesheet from the server to see if the changes you made are actually there? Http caching could be the culprit depending on how you're packaging your CSS.
Next, check the page source to make sure that your page is actually requesting the stylesheet you think it is. For example, if your site is requesting styles.min.css but you only made changes to styles.css and didn't create a new minified version, that'll cause problems.
Third, I'd check the elements that do not have the styles you're expecting and trace the styles with something like Chrome Developer Tools to ensure that your styles aren't being overridden in a way you're not expecting.

CSS and Javascript not applied when using Orbeon Embedding API

I have set up a Tomcat instance based on the orbeon-embedding.war managed to call forms from another Orbeon instance via nav-tabs links.
However, whilst the forms are loaded correctly in the <div>, no styles have been applied and none of the javascript functionality works.
In the host instance, the .css and .js files are specified in properties.local.
In the client instance, I have added filters for .css, .js and .png to the web.xml which resolved 404 errors. When viewing the page source, the links to these resources work. The only remaining 404s I get are the state updates for xforms-server.
I have used the default index.jsp in orbeon-embedding.war as a basis for my launch page.
Is there something that I am missing here?
Does jQuery need to be added to the client page?

Why aren't my HTTP resources being cached?

I have several bundles configured for my MVC5 website. Client-side caching is working for my images, but all of the bundles are being downloaded on every page load.
The query strings on the bundles do not change, and the content of the bundles is not being changed. (As far as I know, anyway -- I'm just reloading the page.)
The cache-related headers look like they should be caching these bundles, yet I'm downloading them every time. What am I missing?

Resources