Solved

Wildfly: Disabling bowser caching of static web pages

Posted on 2016-10-12
5
115 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 57

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

Industry Leaders: 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
SQL to JSON 14 59
How does this modal gets closed? 6 36
change site header 8 26
Check for Numeric Phone Field 14 36
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

731 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