laxman954 / granule

Automatically exported from code.google.com/p/granule
0 stars 0 forks source link

Use filename infix instead of query strings (or add that option) #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
A filename infix will improve support for cache control.

E.g., instead of
    combined.js?id=4658acf30
it should be
    combined.4658acf30.js

Original issue reported on code.google.com by hall.dennis on 24 May 2011 at 11:22

GoogleCodeExporter commented 8 years ago
is it possible to custom the js name and then generate a cache file in file 
system? i think it will be good to cache in proxy server and distributed system

Original comment by cycc...@gmail.com on 3 Oct 2011 at 10:50

GoogleCodeExporter commented 8 years ago
Surely you could achieve this by using a url rewriter...

http://code.google.com/p/urlrewritefilter/

Original comment by m...@mattburns.co.uk on 9 Nov 2011 at 2:23

GoogleCodeExporter commented 8 years ago
We encountered that issue too. That's an important feature for granule because 
without that, most of proxies will cache only one combined.js for the entire 
application :)

So, we patched granule to add an option for having .js like that:
/combined/XXXXXX.js

I can submit the patch or commit code into repository if you're interested.

Pascal

Original comment by PascalHe...@gmail.com on 6 Apr 2012 at 7:58

GoogleCodeExporter commented 8 years ago
please share your patch

Original comment by gautam.n...@gmail.com on 21 Feb 2013 at 1:49

GoogleCodeExporter commented 8 years ago
It would be really useful to be able to change the context path of 
/combined.css and /combined.js to /mycustomcontextpath/combined.css

Thanks

Original comment by pe...@phamola.com on 1 Mar 2013 at 4:27

GoogleCodeExporter commented 8 years ago
Hello,
Since my last comment, I made several modifications to granule so I have no 
patch that will only fix the issue mentionned below.
I made a gzipped tar of my modifications that include : 
- The ability to rename the pattern from /combined.js?id=XXXX to 
/combined/XXXX.js
- The ability to specify JavascriptRewriter and CSSRewriter in configuration 
file. I needed to make some treatments on JS and CSS files before packing them.
- I've introduced a serverName parameter into IRequestProxy in order to have 
different signatures for different server names (we have several domain names 
behind a single web application and it caused issues).
- Fixed an issue for not renaming file names starting with / ( I don't remember 
the issue exactly, it could be safer to avoid that :) , I modified 
CSSHandler.java). 

Sorry for not providing a patch, I hope it helps.

Please note that I moved granule.properties to 
/WEB-INF/classes/com/granule.properties, so I modified the TagCacheFactory 
file: 
    public final static String PRODUCTION_PATH = "/WEB-INF/classes/com/granule.properties";
In fact, I do not use the initialization like that because we instantiate 
directly CompressorSettings.java
Granule may a have a way to customize the configuration file.

By the way, it's in production since 1 year now.

Original comment by PascalHe...@gmail.com on 22 Apr 2013 at 7:14

Attachments: