2

I have a couple of CSS files that I don't want to combine, but I also want to bust cache for those resources, so I declared them with:

<h:outputStylesheet name="css/styles.css?version=#{startup.time}" />

It was working fine until I added the CombineResourceHandler. Now the new handler does not recognize the name of the resource, and I cannot use a wildcard to exclude those resources, something like:

<context-param>
    <param-name>org.omnifaces.COMBINED_RESOURCE_HANDLER_EXCLUDED_RESOURCES</param-name>
    <param-value>css/styles.css*</param-value>
</context-param>

If I remove the version parameter I have to do versioning of those files, which is something I would like to avoid.

Any ideas on how to implement this the easiest way?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
cocorossello
  • 1,289
  • 1
  • 17
  • 30
  • `CombinedResourceHandler` has builtin cache busting. So you could just remove those from your resource names. Let me know if that's sufficient. – BalusC Jun 26 '15 at 09:05
  • No, that's not sufficient, I'll try to take a look in this class to see what's going on – cocorossello Jun 26 '15 at 09:25
  • It's an excluded resource (I need to exclude it), so I guess that's the reasing it's not busting it. – cocorossello Jun 26 '15 at 10:00
  • OK, I see. Well, I just briefly looked at it, but Mojarra didn't like query strings in output style sheet resource name and just returned RES_NOT_FOUND. Perhaps you're using MyFaces? Regardless, always mention in every JSF question which JSF impl/version you are using. – BalusC Jun 26 '15 at 10:21
  • Yes, I'm using myfaces. Sorry, my bad. – cocorossello Jun 26 '15 at 10:34

1 Answers1

2

OmniFaces identifies resources by the internal ResourceIdentifier class. It didn't take into account any query strings, path parameters nor path fragments. As per this commit, this has been fixed. The fix is available in today's latest 2.2-SNAPSHOT.

Support for wildcard pattern in excluded (and suppressed) resources context param would be a good candidate for a feature request.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555