Solved

Wildfly: Disabling bowser caching of static web pages

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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
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…

729 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