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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -