Hi, 

Thanks to Restlet, 
I enjoy REST world in Java :)

I design a huge financial data REST service, 
with spreadsheet-like front end by gwt on client.

 To maximize the throuput, 
I am going to prepare GZIPed JSON on NAS. 

1. Database -> JDBC -> JSON -> GZIP -> Client
2. JSON -> GZIP -> Client
3. GZIP -> Client

With EncodeRepresentation, 
I was able to implement 1 and 2. 

But I can not find a clear way to do 3, 
EncodeRepresentation#write looks related, though. 

Could you suggest a way to achieve something like this?

e.g. GZippedJSONResource
* if client supports GZIP, the content is directly sent, 
otherwise, it is extracted, then is transformed appropriately. 

#represent:
File f = new File(new URI(gzippedJSONURI));
GZippedJSONRepresentation gjr = new GZippedJSONRepresentation(f);
return gjr;

Best,
Takenori

Reply via email to