About the caching problem of static web pages_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:59
Original
1243 people have browsed it

Problem: There is an html static web page. Every time it is opened, the last content will be cached. In this way, even if I update the content, the old content will still be displayed. Even if the Internet is disconnected, it can still be accessed. Add still doesn't work.

Please tell me what to do.


Reply to discussion (solution)

Ctrl F5 to force flash. Or clear the history cache. That's it

You can add a random parameter after the URL, similar to: http://www.baidu.com?p=fdksdjskdsjdjs
In this way, every request will be new and not Caching is used (because the URL is new every time)

Ctrl F5 to force refresh. Or clear the history cache. That’s it
Don’t force refresh. For example, if it’s a small website, you can’t let users force refresh.

You can add a random parameter after the URL, similar to: http://www.baidu.com?p=fdksdjskdsjdjs
In this way, each request will be new and no caching will be used. (Because the URL is new every time)

What does it mean?

Quoting the reply from xzy88 on the 2nd floor: You can add a random parameter after the URL, similar to: http:// www.baidu.com?p=fdksdjskdsjdjs
In this way, each request will be new and no caching will be used (because the URL is new every time)

What do you mean,
How do you open your static web page?
Isn’t it similar to http://127.0.0.1:8080/test.html
?
If so, after the URL you open, add Randomly generated parameters (to be different each time, you can take a time number, etc.)
http://127.0.0.1:8080/test.html?params=Parameter value (randomly generated)
Still don’t understand What I mean is, then I have nothing to do. I just blame my Chinese teacher for not teaching me well at the beginning. I feel ashamed. You can only ask someone else to teach you.

By the way, you won’t tell me, what do you mean? The static webpage is on a certain website, right? Didn’t you develop it yourself? If so, then I’m really speechless. Then my words are in vain. I can only

By the way, you won’t tell me, What you call a static web page is on a certain website, right? Isn’t it developed by you yourself? If so, then I’m really speechless, so what I said is in vain, I can only say

It’s a github blog, it’s my own The site is hosted on github.

This is caused by the browser’s caching policy.

Just change the settings.

Write nocache in the header of your page. You need several metas to cooperate. Check the relevant information yourself.
Use method #2 for css/js/images, such as image.jpg?126312
Of course? The following numbers need to be generated randomly, and it is useless to write them to death. They can be generated with JavaScript.

The blog naturally has a date. What is the use of this requirement?
Most people who go to git to find information look at the update time

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template