Treatment browser cache problem (with timestamp)

2010-12-18  来源:本站原创  分类:Web  人气:64 

For a
<script type="text/javascript">
function convert (url) {
if (url.indexOf ("?")>= 0) {
url = url + "& t =" + (new Date ()). valueOf ();
} Else {
url = url + "? t =" + (new Date ()). valueOf ();
}
alert (url);
}
</ Script>
/ / Special code for verification, when something clicks for one, has no effect

//================================================ ========= handle address =
$. Ajax ({
type: "GET",
url: timeTemp ("AJAXXmlServer "),// other address can also be
data: "username =" + username,
dataType: "xml",
success: callback
});

function timeTemp (url) {
if (url.indexOf ("?")>= 0) {
url = url + "& t =" + (new Date ()). valueOf ();
} Else {
url = url + "? t =" + (new Date ()). valueOf ();
}
return url;
}

相关文章
  • Treatment browser cache problem (with timestamp) 2010-12-18

    For a <script type="text/javascript"> function convert (url) { if (url.indexOf ("?")>= 0) { url = url + "& t =" + (new Date ()). valueOf (); } Else { url = url + "? t =" + (new Date ()). valueOf (); } a

  • google Chrome browser, press the Back button * history.back () cache problem 2010-07-29

    Only google view, the only problem, guess not cache problem: there are other people you come across Page load time, run some ajax code (prototype): if (document.all) ( / / IE window.attachEvent ('onload', sample); ) Else ( / / Other browsers window.a

  • Browser cache summary 2010-03-27

    There are two types of browser cache cache consultation: Last-midified, Etag Complete cache: cache-control, Expires Consultation means the cache needs to ask the server-side pages have not changed, have not changed it returns the cached content 304 d

  • On the browser cache 2010-11-17

    Why use your browser cache There the contents of the cache Cache consultations Simple demonstration of the cache consultations Cache-related header The relationship between the cache-related header Users of different operating Corresponding to differ

  • Browser cache to avoid access application 2011-05-12

    Such a problem often encountered in the project: Program changes made after the existence of the browser cache, users still see the effect when the program does not change. Solutions you can try are: a) url, add the random number b) modify the html h

  • Finally clear the browser cache mechanism of the 2011-09-15

    Problem leads to: a lot of flash applications, websites, do look good, but not many user groups, because a large SWF file servers and many customers, faced with more than 20 seconds have not downloaded something, generally not see the second time in

  • Browser cache, homes or remain 2009-03-25

    Browser cache can reduce the server and client interaction, to reduce pressure on the server. But sometimes do not need to cache it? If I dynamically insert a script element to the request of webwork, through <script src=""/> server reques

  • Rails week 1 (d): Browser Cache 2009-06-16

    Note that we have talked about was the browser cache. About Rails server-side cache, after the special opening title to talk about it anymore. HTTP protocol to support Cache All in all, cache mechanism in order to reduce the number of request to send

  • The browser cache mechanism 2009-08-08

    Cache-Control Cache-Control is the most important rules. This field is used to specify all the caching mechanism in the whole request / response chain must obey the instructions. These instructions are earmarked for the cache to the request or respon

  • (META Set) JSP page caching technology - the browser cache (reprint) 2010-06-08

    (META Set) JSP page caching technology - the browser cache Keywords: meta I. Introduction Idea cache layer can be applied to all aspects of the software. It is an internal mechanism to the outside world is concerned, is not perceived. The database ca

  • Disable browser cache 2010-09-24

    Years, met a lot of secondary development process to disable the browser cache situation, re-check every time is too much trouble from the Internet Recorded for later query <meta http-equiv="Cache-Control" content="no-cache" /> &

  • Optimize the browser cache 2011-08-30

    Optimize the browser cache Most of the Web resources are rarely modified, such as: CSS, Javascript, Images. These resources take time to download the browser, the browser or proxy cache can reduce access to these resources, the number of pages. Cache

  • Hibernate cache problem 2010-03-29

    1. With regard to hibernate caching problems: 1.1.1. The basic theory of caching Hibernate cache is divided into two, the first-level store in the session, called a cache, the default and can not be unloaded with. The second level is controlled by th

  • OpenJPA2 cache problem 2010-04-02

    By JPA2 the temptation to try a bit recently OpenJPA, when the cache is in the configuration information for the online tutorial: http://hi.baidu.com/f1jee/blog/item/68c87b343fa047305ab5f54d.html http://book.51cto.com/art/200806/76706.htm Although I

  • Image will be loaded into the use of images in the browser cache 2010-06-19

    When submitted to show that adding a picture, is a later picture, please, but its image size large change in the onclick event of the background image, will lead to download the file, but could not download the complete document when submitted to the

  • Browser cache form data 2010-08-22

    Ticket services, contact page, the server transfer over the user booking number 3 (corresponding to form data for the <input type="usernum" value="3"/>), Js dynamic deletion of users take advantage of the number of people, the la

  • Mobile browser's cache limit [transfer] [Mobile Browser Cache Limits: Android, iOS, and webOS] 2010-12-16

    Webkit iphone encountered today on the cache issue, foreigners found an article, I feel very good, turn to share. Original link: http://www.yuiblog.com/blog/2010/06/28/mobile-browser-cache-limits/ Here are some excerpts: 1.Android The Android browser

  • MyReader cache problem 2010-12-17

    Two days in a MyReader add caching, the cache is mainly a list of each atom, so do not have time to switch the interface to re-fetch, tiny first way is to use C + + read and write files directly, the existence of each list as a json file, ten minutes

  • To prevent the browser cache css, js static files [transfer] 2011-01-11

    Under what circumstances, to prohibit the static file cache: 1, is often possible to change the js, css. Such as a html file, test.html in the 1.0 version. It may be so <script src="common.js"> </ script> The revised version v1.1: &l

  • Ie image cache problem 2009-08-06

    When do stop often alter some of the pictures, but the picture the name of the same (because the program has not changed), but with the new image replaces the old image, so that, ie put the picture down to the cache, even if you update later, look at