URL Customize

81 views
Skip to first unread message

Илья Бреев

unread,
Apr 29, 2013, 5:58:59 AM4/29/13
to cass...@googlegroups.com
Hi, Andrew!

For bundle URLs i have such great thing as bundle name and i can do something like this:

bundles.Add<StylesheetBundle>("~/custom-path", new[] { "file1", "file2" });

This trick hides actual application relative path of files in bundle.

How can I customize image URLs generated by Cassette from my css file?
I don't want to include actual relative path of image into generated URL.

Andrew Davey

unread,
Apr 29, 2013, 8:42:52 AM4/29/13
to Cassette
I don't think this is possible right now. Cassette serves image files by rewriting the incoming Cassette file URL back into a normal file request. See https://github.com/andrewdavey/cassette/blob/master/src/Cassette.Aspnet/RawFileRequestRewriter.cs#L23

Obfuscating the original image file name would mean having to maintain a mapping back to the real file path. It might be possible to do this, but would require some custom bundle pipeline work and a custom IUrlGenerator at least...

What's your use case for this?


--
You received this message because you are subscribed to the Google Groups "Cassette" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cassette+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Илья Бреев

unread,
Apr 30, 2013, 5:16:10 AM4/30/13
to cass...@googlegroups.com
I have an application which serves multiple domain names. Appplication structure includes directory "StaticContent" and that directory includes subdirectories for all of domain names served by application.
If i view css through developer tools after page load, i can see image urls for example like this "cassette.axd/file/hash/StaticContent/domain.com/img/image.png". I just want to hide "StaticContent/domain.com/img/image.png" maybe by replacing it with some kind of hash.

понедельник, 29 апреля 2013 г., 16:42:52 UTC+4 пользователь Andrew Davey написал:

Andrew Davey

unread,
Apr 30, 2013, 6:28:14 AM4/30/13
to Cassette
OK, well like I said previously, this is probably achievable, but would take quite a bit of work. So unless there's a pressing business requirement to obscure URLs, I'd say it's not worth the effort.
Reply all
Reply to author
Forward
0 new messages