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
984 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
- How to use custom font during html to pdf conversion?
- Storing the preferred font-size in localStorage
- mp4 embedded videos within github pages website not loading
- Is there any way to glow this bulb image like a real light bulb
- What can I do to improve my coding on both html and css
- Uncaught TypeError: google.maps.LatLng is not a constructor at init (script.js:7:13)
- Bootstrap modal not showing at the desired position on a web page when the screen size is smaller
- How to increase quality of mathjax output?
- Hover animation resetting( seemingly reverting back to original CSS and then again to hover)when moving mouse horizontaly accross a part of an element
- Storing selected language in localStorage
- How to clip grid cell and provide scroll as well?
- KeyboardAvoidingView makes a messy the flexbox
- Rotate an object around another object in javascript
- Understanding Scroll Anchoring Behavoir
- how to use only block layout in this css code?
Related Questions in ASP.NET
- Implementing Azure AD B2C Authentication in .NET 8 Blazor Project (RenderMode: InteractiveAuto)
- Azure Application Insights Not Displaying Custom Logs for Azure Functions with .NET 8
- IIS Rewrite Module exclude bots but allow GoogleBot
- Angular 16 sending null values to API
- I am the domain admin, newbie, how do I connect youtube.com on my domain?
- Dropdown list showing SQLServer2005SQLBrowserUser$DONSERVER instead of Active Directory group name in ASP.NET MVC C#
- ASP.NET Identity, Losing Ability to Login until Application Pool Recycles
- How to unprotect ASP.NET FormAuthentication cookie
- How does it work using ASP.NET FormAuthentication
- What is the purpose of a completely standalone 'this'?
- Is there a way to read .csproj PropertyGroup variable in c#
- MSBuild trying to copy different dll with similar name into project sporadically
- Minimizing IdentityServer4 Round Trips in Microservice Architecture with Ocelot
- Azure AD guest account in web app authentication user claims data
- Receiving 400 bad request on post when customer auth handler is used
Related Questions in IMAGE
- Golang lambda upload image into s3 static website
- Put an image behind the title in a WP, WooCommerce "shop" page
- How to create an JSOUP element from byte array image (Load from Database)
- Cloudflare not respecting Cache-Control
- Sending multiple images and data in a single angular observable
- Create and combine several images into a single image for my react native App
- Should I compress images in java backend before sending to frontend?
- Javascript Place Image Where User Clicks
- Whitespace in document has a bottom border remnant or some other line at the bottom of the whitespace
- Sony Spresense Camera Board
- After completely installation and done all the work i am getting Permission denied error do any one have solution
- HTML page on NAS server image not showing on mobile phone
- mouse coordinates in image go below 0 and above width
- Why are the css images or js not loading in my laravel project?
- Python pillow library text align center
Related Questions in CACHING
- Using Puppeteer to scrape a public API only when the data changes
- Caching private wordpress rest endpoints
- Cloudflare not respecting Cache-Control
- Unexpected Recursive Call
- Cannot serialize (Spring Boot)
- Nginx only caches file endpoints
- The Selenium application properties folder holds two environment options. After running a test the environment setting changes to a previous setting
- Launch jobs in cache in a loop in bash script
- Multiple async request do not store anything to cache
- Dev tool for Next.js cache on the client?
- Creating a letter in the terminal by entering
- Laravel: check if cache has key with thag
- The retrieval time for the Apache Ignite cache is too long
- How to run gradle with caches files
- Docker Run cache mount does not cache apt-get dependencies
Related Questions in SYSTEM.WEB.OPTIMIZATION
- Why dont js files get minified if I include them in BundleConfig?
- Bundling and minification of ES6 javascript files in an asp.net MVC web application
- System.Web.Optimization minifying arrow function issue
- Create ThemeBuilder for dynamic themes
- Web page load issue intermittently and no html/js requests triggered except the bundles from Asp.net MVC
- AngularJS angular-ui-router.min.js breaks app when BundleTable.EnableOptimizations = true
- Set background image URL in CSS file to another site
- ERROR Could not load type 'dotless.Core.configuration.WebConfigConfigurationLoader' from assembly 'dotless.Core, Version=1.5.3.0
- System.Web.Optimization StyleBundler removes space from infront of + but not - when compiling and minifying less
- ASP.NET and Visual Studio doesn't send scripts / style bundles
- How do you Cache-bust individually rendered files while debugging?
- How can I use System.Web.Optimization (.net js bundler) with amd modules?
- How do i write a CDN fallback expression when loading a script asynchronously?
- ASP.NET MVC: StyleBundle IncludeDirectory & CssRewriteUrlTransform
- asp.net Webforms Bundling & minification - Bundled script throws 404
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 # Hahtags
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+