Asp classic asp缓存CSS文件

Asp classic asp缓存CSS文件,asp-classic,vbscript,web,Asp Classic,Vbscript,Web,嗨,我正在编写一个经典的ASP,当我导入我的CSS时,它正在被缓存,我希望能够从缓存中删除它。因为我只在特定场景中使用CSS文件 谁能帮忙吗 <% If Session("SG_bIsRemoteBetslip")= True then %> <style type="text/css" media="screen, tv, projection"> @import url(/Marketing/Site-Files/Sportsbook/Betslip/remote-b

嗨,我正在编写一个经典的ASP,当我导入我的CSS时,它正在被缓存,我希望能够从缓存中删除它。因为我只在特定场景中使用CSS文件

谁能帮忙吗

<% If Session("SG_bIsRemoteBetslip")= True then %>
<style type="text/css" media="screen, tv, projection">
@import url(/Marketing/Site-Files/Sportsbook/Betslip/remote-betslip.css);
</style>
<% Session("SG_bIsRemoteBetslip") = False %>
<% End If %>

@导入url(/Marketing/Site Files/Sportsbook/Betslip/remote Betslip.css);

只需向src传递查询字符串,即可防止css缓存:

<% 
If Session("SG_bIsRemoteBetslip")= True then
    response.write "<style type=""text/css"" media=""screen, tv, projection"" href=""/Marketing/Site-Files/Sportsbook/Betslip/remote-betslip.css?ID=" & Server.urlencode(now()) & """ />"
    Session("SG_bIsRemoteBetslip") = False   
End If
%>


这当然不是很吸引人,但它可以快速简便地强制所有访问者更改css,而不考虑他们的缓存。

缓存css有什么问题?或者,您的意思是
IF
语句没有达到您的预期?还有,为什么要使用@import而不是style标记的
src
属性?