asp.net mvc 3 - Can we cache images, css and java script in MVC3 through Output Cache? -
can cache images, css , javascript of specific view (not partial view) in mvc3 through outputcache attribute. want cache home controller view.i tried contents cached not images , css.
instead of output cache attribute can use following methods have caching of static resources:
1.using max-age. put below section in web.config in <configuration>
-> <system.webserver>
section
<staticcontent> <!-- tell client cache static files year --> <clientcache cachecontrolmode="usemaxage" cachecontrolmaxage="365.00:00:00" /> </staticcontent>
2.using url versioning. can done bundling. if using mvc3 @ combres on nuget. in mvc4 or above build-in option: bundling , minification
Comments
Post a Comment