combres icon indicating copy to clipboard operation
combres copied to clipboard

Change in the URL format

Open MiguelTVMS opened this issue 11 years ago • 7 comments

We are using combres and i want to know if we can change the URL format from /combres.axd/scripts.head/-1858562714/ to /combres.axd/scripts.head?r=-1858562714

This would help us a lot since for Akamai the url ending with "/" is a directory and may take from 20 to 40 minutes to purge or invalidate and the url using "?" take from 1 to 7 minutes to purge or invalidate.

MiguelTVMS avatar Feb 13 '14 07:02 MiguelTVMS

Not possible at the moment, but it can be coded quite easily. The place to look at is API/WebExtensions.cs. I believe you only have to modify UrlPattern and update routing logic in AddCombresRoute. If you can make a generic change, i.e. allow the pattern to be customizable in combres.xml, send me a PR.

buunguyen avatar Feb 13 '14 19:02 buunguyen

FWIW, including a query strings in the URL for static resources prevents certain proxies from caching the results.

I'd also venture to ask why you would need to invalidate the cache? If the content changes, the URL should change as well...

ericberens avatar Mar 10 '14 04:03 ericberens

The problem is that for Akamai, one of the biggest company on edge caching, to clean a url with query string takes 7 minutes to remove all the query string variations. and to clean a folder and all sub folders takes from 30-40 minutes. We know that combres does not generate a folder but if we want to clean all my js i have to clean /combres.axd/scripts/* what is considered all subfolders and if we need to clean all the variations for the url /combres.axd/scripts* is considered a unique url. We need to clean the cache because some of our pages are cached on akamay and the url for the javascript is cached within the page. If we have to fix somenthing we have to clean the js url and the pages. Cleaning the pages in the middle of the day hurt our servers and penalize to much our performance. If you try to use System.Web.Optimization for doing what combres does you will notice that it uses the query string approach.

Sorry for my english but it's not my native language.

MiguelTVMS avatar Mar 10 '14 08:03 MiguelTVMS

I think it's best if there's a config for this, something like:

<resourceSets url="~/combres.axd" useQueryString="on" />

I would love to receive PR.

buunguyen avatar Apr 30 '14 20:04 buunguyen

Hi, I've got a similar issue, but hoping there may already be a workaround. I've got Combres running in a webforms project (with defaultVersion set to auto) and it's working great when running in IIS7, however, I get errors related to the query strings in IIS Express when in debug mode: Invalid querystring value for parameter []. The links are rendered as: /styles.css?4a3c443bec6d5101dfc043d528183347 I'm hoping to change the links to something like: /styles.css?v=4a3c443bec6d5101dfc043d528183347 which works fine in IIS Express

CombresForWebForms avatar May 15 '14 23:05 CombresForWebForms

What would really be helpful is an extension point that allowed for customization of the urls that are generated. Something along the lines of what I suggested in this work item: http://combres.codeplex.com/workitem/7678

dplaskon avatar Aug 15 '14 13:08 dplaskon

@buunguyen i think you idea would be great.

MiguelTVMS avatar Feb 27 '15 21:02 MiguelTVMS