ajax 是不是有缓存
ajax 是否有缓存?
ajax 是否有缓存?我的意思是比如同样的请求,有没啥类似缓存的操作啊?不用在进行数据库的查询操作!是否利用php实现数据缓存啊?
------解决方案--------------------
你在客户端用js就可以判断啊。如果同样的请求直接取缓存中的数据。
php当然也是可以的。
------解决方案--------------------
ajax是否有缓存,我觉得这个问题是存在的。当你在传输数据的时候,可以将时间作为一个变量进行传递。这样可以避免缓存产生。
------解决方案--------------------
你可以将ajax 请求页面缓存在客户端XX秒
header设定好Etag Cache-Control Expires 等信息控制缓存时间
另外ajax请求的时候,不要加上Math.random()
------解决方案--------------------
默认情况下IE有缓存,你调用同样的URL的时候第二次开始直接返回缓存,根本不操作服务端。火狐和谷歌木有。
不过可以设置的,比如设置URL的时候带随机数过去或者header设置cache-control为no cache神马的。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Validator can be created by adding the following two lines in the controller.

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c
