Problem with caching of "wroResources"

75 views
Skip to first unread message

stanisla...@gmail.com

unread,
Jul 27, 2015, 5:07:16 AM7/27/15
to wro4j
Hello,

I have spring (boot) application with wro4j. Everything works well from functional perspective but only strange thing I have noticed is that "wroResource import" is not being cached properly. I am using font awesome inside my CSS group (called other). Other.css itself is "cached" properly


The problem is when font file itself is being fetched by browser (chrome)


My used configuration (this configuration is passed to wro4j ConfigurableWroFilter) as recommended from LESS "documentation" (although font-awesome is not using less, I used "standard" CSS form). 


# wro4j config

wro.preProcessors=cssUrlRewriting,cssImport,semicolonAppender,lessCss

wro.postProcessors=cssVariables,cssMinJawr,jsMin

wro.resourceWatcherUpdatePeriod = 1

wro.ignoreMissingResources = false


What can be wrong? Or is it expected? 

thanks

Stano




Alex Objelean

unread,
Jul 27, 2015, 5:19:16 AM7/27/15
to wr...@googlegroups.com
Hi Stanislav,

the external resources (like fonts, images, etc) are not cached explicitly by wro4j by default. Only groups are cached out of the box. 
As a short term solution, you could use a filter which would add cache headers to imported resources. A long term solution would be to create an urlRewritingProcessor which would encode a hash of the imported resource in combination with aggressive caching (far expiry date).  Could you open a feature request for this use case?

Thanks,
Alex

--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

stanisla...@gmail.com

unread,
Jul 29, 2015, 4:37:17 PM7/29/15
to wro4j, alex.o...@gmail.com
Thanks for answer. I have created new issue for that https://github.com/wro4j/wro4j/issues/963
Reply all
Reply to author
Forward
0 new messages