如何缓存CSS,图片和js?缓存、图片、CSS、js

2023-09-02 12:00:50 作者:QQ网名大全

我想有图像,CSS和他们的浏览器的JavaScript缓存客户端时,加载一个网页。有这么多不同类型的缓存我很困惑,用asp.net mvc的使用哪些。

I would like to have images, css, and javascript cached client-side on their browser when they load up a web page. There are so many different types of caching I am confused as to which ones to use with asp.net mvc.

难道也有可能有他们的浏览器检查这些文件的新的或修改的版本?

Would it also be possible to have their browsers check for new or modified versions of these files?

谢谢!

推荐答案

浏览器照顾这个为您自动,其实。你必须走出自己的路,让他们不缓存的CSS,JS,HTML和图像。

Browsers take care of this for you automatically, actually. You have to go out of your way to get them to NOT cache css, js, html and images.

我没那么熟悉ASP MVC的,但我认为他们缓存类型,你在想的是运code缓存为您创建的动态输出服务器端?

I'm not that familiar with ASP MVC, but I think they type of caching you're thinking of is opcode caching for your created dynamic output server-side?