Nov 13, 2013, 5:34 PM
[CLOSED] WebResource.axd resources are not gzipped. Is it possible to make Ext.NET's Resource Handler public?
Hi,
In the Ext.NET book (p.321) I talk about using embedded resources for custom components, plus some scenarios where you might want to do this (as it is not mandatory) for example, to ship a component fully encapsulated, or to save the hassle of remembering to include the right resources in each page that might use the custom component (if you don't want to include it once in a master template or similar).
I've regrettably overlooked that these embedded resources, although they would use the ASP.NET web resource, will not get gzipped (seems a limitation to me; not sure why they don't support it - by comparison, ScriptResource.axd, does support gzip). Some module/handler-based solutions exist, but they seem to have side-effects from my quick look.
I guess the options, therefore, are
For my main project where I use Ext.NET I am seriously thinking of abandoning the Embedded Resource approach (in about 90% of the cases I think) in favour of migrating towards Bundles, as that will also automatically minify as well as compress and can be used with WebForms and MVC.
But would it be possible to make your resource handler public so it is usable by others? Looking at the code briefly it looks like there are some things specific to Ext.NET so it may not be easy to do that without some refactoring?
Or have I missed other options?
Thanks!
In the Ext.NET book (p.321) I talk about using embedded resources for custom components, plus some scenarios where you might want to do this (as it is not mandatory) for example, to ship a component fully encapsulated, or to save the hassle of remembering to include the right resources in each page that might use the custom component (if you don't want to include it once in a master template or similar).
I've regrettably overlooked that these embedded resources, although they would use the ASP.NET web resource, will not get gzipped (seems a limitation to me; not sure why they don't support it - by comparison, ScriptResource.axd, does support gzip). Some module/handler-based solutions exist, but they seem to have side-effects from my quick look.
I guess the options, therefore, are
- Stick with Embedded Resources and WebResource.axd (and manage any gzip/minification versions manually/yourself)
- Try to create your own handler (can be tricky to get right to factor in gzipping, client caching support, minification, and so on)
- Use Bundles from ASP.NET or similar custom bundling solutions that support gzip (and minification as a bonus)
- Use Ext.Net.ResourceHandler (if it was public)? (As well as gzipping, this also supports minification as a bonus)
For my main project where I use Ext.NET I am seriously thinking of abandoning the Embedded Resource approach (in about 90% of the cases I think) in favour of migrating towards Bundles, as that will also automatically minify as well as compress and can be used with WebForms and MVC.
But would it be possible to make your resource handler public so it is usable by others? Looking at the code briefly it looks like there are some things specific to Ext.NET so it may not be easy to do that without some refactoring?
Or have I missed other options?
Thanks!
Last edited by Daniil; Nov 27, 2013 at 7:04 AM.
Reason: [CLOSED]