I am using System.Web.Optimization to bundle css and js files. So from what I understand System.Web.Optimization is caching js and css bundle on client side and that works fine. I checked my calls on fiddler first time when page loads for js and css bundle I am getting status 200 and next time its coming from client browser cache and there is no entry for js and css bundle in fiddler. But for images I keep getting status 304 unmodified everytime I load my page. I want to browser cache all my images as well that are coming from CSS. Does anyone know how to do that using bundling System.Web.Optimization? Thanks, Alkingson
System.Web.Optimization bundling css js caching
983 Views Asked by Alkingson AtThere are 2 best solutions below
Ryan
On
The System.Web.Optimization bundles are for CSS and JavaScript to combine into one call instead of many HTTP requests.
Have look into leverage browser caching :
What browser caching does is "remember" the resources that the browser has already loaded. When a visitor goes to another page on your website your logo, CSS files, etc. do not need to be loaded again, because the browser has them "remembered" (saved). This is the reason that the first view of a web page takes longer than repeat visits.
When you leverage browser caching, your webpage files will get stored in the browser cache. Your pages will load much faster for repeat visitors and so will other pages that share those same resources.
http://websitespeedoptimizations.com/LeverageBrowserCaching.aspx
Related Questions in CSS
- CSS Class is not applying to element (border width,color,and style attributes)
- How do I find the fonts that are not loading in a CORS situation ( MoovWeb )?
- Positioning child at bottom of parent with scroll
- Play multiple audio files in a slider
- How to set text over image?
- Website zoomed out on Android default browser
- Writing/Overwriting to specific XML file from ASP.NET code behind
- My navbar is not expanding after collapse
- when a checkbox is checked how to display a different hidden element using javascript
- Gaps Vertically Using Dividers
- CSS: Preventing a property to affect on element until the end of transition
- Polygon Button with pure CSS
- transform-origin doesnt apply in safari
- show/hide multiple div tags at once and change the size of the remaining div tag
- Mask the image/maps/div (circle) using css and jquery
Related Questions in ASP.NET
- Create an IIS web request activity light
- Writing/Overwriting to specific XML file from ASP.NET code behind
- What is the point of definnig Asp.net Intrinsic Objects In different places and what is the different betwen them?
- Deleting Orphans with Fluent NHibernate
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- Entity Framework Code First with Fluent API Concurrency `DbUpdateConcurrencyException` Not Raising
- Getting deeply embedded XML element values
- What is best way to check if any of the property of object is null or empty?
- NuGet - Given a type name or a DLL, how can I find the NuGet package?
- ASP-MVC Code-first migrations checkbox not active
- How do i add onclient click to my jquery button
- Jquery: Change contents of <select> tag dynamically
- Retrieving data from Oracle database
- ASP.NET: Fill Textbox field upon dropdownlist selection by user
- Why web API return 404 when deploy to IIS
Related Questions in IMAGE
- Add image to JCheckBoxMenuItem
- Display images on Django Template Site
- How to resize images with PHP PARSE SDK
- Animation in Java on top of JPanel
- Slow performance on ipad erasing image
- What are the pros and cons of the picture element?
- Carrierwave file upload with different file types
- How to use annotorious with angular
- Images not showing when uploaded to server
- ImageView doesn't show up
- Image Resizing adjusts ratio
- Displaying bitmap image on Android (OpenCV)
- Class 'Imagick' not found - PHP and Windows
- Image position - randomly select position
- Replace image 1 with image 2 after 5 sec
Related Questions in CACHING
- ClassCastException: datastructures.instances.JClass cannot be cast to java.util.ArrayList
- Robospice. How to save data and how to get data from DB?
- Make @lru_cache ignore some of the function arguments
- Xib taking long time (>1s) to load. UIFont cache seems to blame
- Android picasso cache images
- Rails 4 low-level caching not working
- How to cache Exchange web service API autodiscoverurl?
- The process cannot access the file because it is being used by another process asp.net
- Alamofire loading from cache even when cache policy set to ReloadIgnoringLocalAndRemoteCacheData
- Java Heap vs Cache
- In what use cases is locking on ASP.NET cache required/desirable
- Chrome cache overriding angularjs disabling of cache
- AFNetworking 2.0 Cache Issue
- Symfony ESI Cache / Surrogate Listener Issue
- Using getOrElseUpdate of TrieMap in Scala
Related Questions in SYSTEM.WEB.OPTIMIZATION
- System.Web.Optimization minifying arrow function issue
- Bundling and minification of ES6 javascript files in an asp.net MVC web application
- Could not load file or assembly 'System.Web.Optimization, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
- LESS files intermittently not being included in Bundle
- Bundling querysting token is not being generated
- MVC4 bundling of DevExpress controls?
- MVC4 bundling javascript or css files from a different domain?
- Set background image URL in CSS file to another site
- asp.net Webforms Bundling & minification - Bundled script throws 404
- ASP.NET MVC 4 Bundles giving 404 error
- Why dont js files get minified if I include them in BundleConfig?
- Is Remote Bundling of resources on a CDN possible?
- System.Web.Optimization bundling css js caching
- Can you pre-cache ASP.NET Bundles?
- ASP.NET css minification fails when filter: progid:DXImageTransform.Microsoft.AlphaImageLoader is used
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The System.Web.Optimization bundles are for CSS and JavaScript. They don't have anything to do with caching images. You'll want to take a different approach to do that:
Option 1: Set it in the IIS settings in the web.config like this:
http://www.iis.net/configreference/system.webserver/staticcontent/clientcache
Option 2: If they are images that you are returning from code, you can set the cache headers as part of the response, like this:
http://forums.asp.net/t/1947339.aspx?How+to+cache+Images+at+client+side+