Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to achieve the functionality of caching all static resources and deliver as html pages.

I'm using asp.net 4.5 with SQL Server

What I have tried:

Package that speeds up loading of JavaScript, CSS and image files[^] but this looks old.

Also, I can use this for the time being if I can exclude a couple of folders (with sub-application).
Posted

1 solution

If you're caching per user, browser cache is still your best friend. However, server-side cache does one thing browser cache cannot do, that is, shared cache for multiple users. In that case, you can simply use Application instead of Session to cache whatever you want. Remember to implement locking properly though. Say, you have 1,000 concurrent users accessing your site. You easily end up with hundreds of threads accessing shared resources. Things go bad really fast if you don't lock them.
 
Share this answer
 
Comments
Mr_cool 2-Sep-21 2:19am    
How to do it? Any package for the same? Combineandminify is one but too old.
Code Fan 2-Sep-21 13:55pm    
You can try this list (https://nugetmusthaves.com/Tag/caching). If you have all your media resources in a database, you can use Redis as well. I usually handwrite my own cache mechanism, because customization can sometimes be more complicated than writing it all from scratch.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900