[undertow-dev] Undertow 1.3.0 - rewrite HTML content

Stuart Douglas sdouglas at redhat.com
Wed Mar 9 17:51:00 EST 2016


Why not just rewrite them at build time? It will be much more efficient than trying to do it every time you serve the file.

In general this is not an easy problem, you need to use a HTML parser to parse the page, modify it and then rewrite it, which will be slow (alternatively you could try hacking up something using regex's or similar, but it hard to make it work all the time). 

Stuart

----- Original Message -----
> From: "Hugo Calado" <hugo.calado at gmail.com>
> To: "Stuart Douglas" <sdouglas at redhat.com>
> Cc: undertow-dev at lists.jboss.org
> Sent: Wednesday, 9 March, 2016 9:37:27 PM
> Subject: Re: [undertow-dev] Undertow 1.3.0 - rewrite HTML content
> 
> Just static files.
> 
> Hugo
> 
> 2016-03-08 21:44 GMT+00:00 Stuart Douglas <sdouglas at redhat.com>:
> 
> > Are these simply static files, or dynamically generated?
> >
> > Stuart
> >
> > ----- Original Message -----
> > > From: "Hugo Calado" <hugo.calado at gmail.com>
> > > To: undertow-dev at lists.jboss.org
> > > Sent: Wednesday, 9 March, 2016 3:55:28 AM
> > > Subject: [undertow-dev] Undertow 1.3.0 - rewrite HTML content
> > >
> > > Greetings,
> > >
> > >
> > > How can i rewrite the path inside html files.
> > >
> > > Original HTML file:
> > >
> > > .... < script type = "text/javascript" src = " /v/js/abc.js " ></ script
> > >
> > >
> > > After rewrite:
> > >
> > > .... < script type = "text/javascript" src = " /v123/js/abc.js " ></
> > script >
> > >
> > > The main objective is to solve browser cache issues assuring that in
> > each new
> > > release the url's of static objects are modified,
> > >
> > > Thank you,
> > > Hugo Calado
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > undertow-dev mailing list
> > > undertow-dev at lists.jboss.org
> > > https://lists.jboss.org/mailman/listinfo/undertow-dev
> >
> 


More information about the undertow-dev mailing list