开发者

ASP.NET MVC Is it possible to have image version like javascript version?

开发者 https://www.devze.com 2023-03-30 14:58 出处:网络
all. I want to version image on site. Example for usage is n开发者_StackOverflow社区ext: my site have some image (e.g. search bar background 190px width). When I changed background image, I saved it w

all. I want to version image on site. Example for usage is n开发者_StackOverflow社区ext: my site have some image (e.g. search bar background 190px width). When I changed background image, I saved it with same file name). After that, I accessed page, but old image was displayed and page design crashed. I could see good image with only ctrl+f5.

Is there any kind of image version algorithm similar u js versioning?

Thanks in advance.


The standard technique for cache busting is to change the URI by adding or modifying the query string. There is nothing language specific about that.

If you are modifying a background image that is a standard part of the design, then you should be just editing your CSS to change the URI. Neither ASP.NET nor JS needs to be involved.

0

精彩评论

暂无评论...
验证码 换一张
取 消