Solved

Wildfly: Disabling bowser caching of static web pages

Posted on 2016-10-12
5
95 Views
Last Modified: 2016-10-18
I have an AngularJS index.html page and am having a problem in Wilfly 8.1.0 that the page is being cached (it is in a war file).

I know that the old <meta http-equiv... header tags are highly unrelieable.

Is there a way to force Wildfly to server the default values of:

    Cache-Control: no-cache, no-store, must-revalidate
    Pragma: no-cache
    Expires: 0

in the HTTP response header?
0
Comment
Question by:James Talvy
5 Comments
 
LVL 56

Expert Comment

by:Julian Hansen
ID: 41840567
Cached - I am assuming you mean cached on the browser and not the server?

What role is Wildfly playing in this?

Can you describe the problem a bit more - you have an Angular page - which should not be affected by caching as it runs off the state of its model - which is not cached.
0
 
LVL 1

Accepted Solution

by:
James Talvy earned 0 total points
ID: 41840576
The index.html which contains the AngularJS refs is being cached by the browser.  You have to empty the cache or try Ctrl-Shift-Reload to force it.

I found this article to update the <filters> in the standalone.xml and will try it out:

https://gist.github.com/remibantos/5e86829e1ba6ad64eea1
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 41840799
Firefox says that they cache everything.  If you click on 'Back', they use the cached version.  The anti-cache measures may affect when you are loading the page the first time.

What specific problem are you having?  Making pages work in spite of caching has become a 'normal' thing now on the web.
0
 
LVL 27

Expert Comment

by:BigRat
ID: 41841696
I don't know this thing in detail, having seen it once in action, but I presume there is nothing in the console (at http://<host>:9990/console)?

Personally I build my Angular Apps with Grunt and minify all the Javascript and HTML into files, which have automatically generated names from release to release. In this way it is irrelevant what the browser stores from release to release, but has the advantage of caching the "code" for a given release.
1
 
LVL 1

Author Closing Comment

by:James Talvy
ID: 41847984
None of the suggestions yielded anything diff that what I learned on my own.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Non-Resizable Pharagraph 2 17
Validating Date 4 28
Regular Expression needed 4 13
WordPress Page Content Lost 2 13
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question