Hello, i'm struggling with delivering a transformed resource for each
request.

Here is exactly what i mean:

There are two requests expected to hit the app.
1) a request containing a unique identifier and some other values as
request parameters.
This request will hit a dispatcher which will store the data into
hazelcast, and render a response which will contain urls to two assets (one
js one css) with a request parameter (the unique identifier).
Here is how an example response looks like:

<modifier>
<javascript>
<filepath>
http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmjs?trid=unique_identifier
</filepath>
</javascript>
<css>
<filepath>
http://localhost:8080/app/assets/1.0.0-SNAPSHOT/ccdd/template.nmcss?trid=unique_identifier
</filepath>
</css>
</modifier>

This is a machine-to-machine request. The system that made the request will
give the asset urls to the client when rendering a webpage.

2) the second request is the one coming from the client. It is a request
for the actuall assets. It should return the asset but replace the
placeholders within the asset with values from hazelcast.
I currently have an AssetHandler mapped to the "ccdd" path.
In the AssetHandler i get the request parameter and get the values from the
hazelcast map. Then the values are stored on the environment stack for my
ResourceTransformer to access. This whole thing is working and i get a
properly transformed asset for the first request.

My problem is that when the unique identifier changes the resource is not
transformed again.

So my questions are:

Is it possible to cache resources selectively?
Am i doing this in a completely shitty way?

I hope that my explanation is understandable. Thx in advance for any
responses!

Reply via email to