Solved

Wildfly: Disabling bowser caching of static web pages

Posted on 2016-10-12
5
23 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 51

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 82

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now