关于 WebView 缓存的重写

本贴最后更新于 2600 天前,其中的信息可能已经时异事殊

在现在的 app 中,越来越多的公司开始使用 webview 来进行一些活动页面的展示,甚至一些公司开始使用 webview 做为主要显示组件,把所有的内容都使用 H5 来呈现,这样一来,就对 WebView 的加载速度开始有越来越高的要求,我们要讨论的是 webview 的原本缓存机制所存在的弊端和如何复写 WebView 的缓存机制。

首先说一下 webview 的自带缓存机制的弊端:
webview 的自带缓存机制是无差别缓存,也就是说,不管是页面,样式还是图片,都会缓存到本地,刷新 webview 的缓存一般分为以下几种:

LOAD_CACHE_ONLY: 不使用网络,只读取本地缓存数据
LOAD_DEFAULT: 根据 cache-control 决定是否从网络上取数据。
LOAD_CACHE_NORMAL: API level 17 中已经废弃, 从 API level 11 开始作用同 LOAD_DEFAULT 模式
LOAD_NO_CACHE: 不使用缓存,只从网络获取数据.
LOAD_CACHE_ELSE_NETWORK,只要本地有,无论是否过期,或者 no-cache,都使用缓存中的数据。

反正不管以上几种具体情况如何,都肯定不是我们想要的。

我们想要的机制是:
1.缓存自己想要缓存的内容。
2.指定一个缓存策略,在需要的时候重新去服务器获取最新数据

于是我想到了以下方法
重写

Java 代码 "收藏这段代码")

  1. WebViewClient.shouldInterceptRequest(WebView view,WebResourceRequest request)

方法
首先需要新建一个类,继承 WebViewClient:

Java 代码 "收藏这段代码")

  1. public class DVDWebViewClient extends WebViewClient

然后实现

Java 代码 "收藏这段代码")

  1. public WebResourceResponse shouldInterceptRequest(WebView view,WebResourceRequest request)

方法
shouldInterceptRequest 方法会将所有页面的资源 URL 都一一列举出来,这样一来就好办了,我们似乎只需要缓存自己想要缓存的 url 就可以了。
然后事实是不是这样的呢?

Java 代码 "收藏这段代码")

  1. @Override
  2.  public WebResourceResponse shouldInterceptRequest(WebView view,  
    
  3.                                                    WebResourceRequest request) {  
    
  4.      //获取本地的URL主域名  
    
  5.      String curDomain = request.getUrl().getHost();  
    
  6.      //这行LOG可以不看  
    
  7.      if (BuildConfig.DEBUG) {  
    
  8.          Log.d(LOG_TAG, "curDomain " + curDomain + " request headers " + request.getRequestHeaders());  
    
  9.          for (Map.Entry entry : request.getRequestHeaders().entrySet()) {  
    
  10.              Log.d(LOG_TAG, "key=" + entry.getKey() + " #####value=" + entry.getValue() + "\n");  
    
  11.          }  
    
  12.      }  
    
  13.      //取不到domain就直接返回,把接下俩的动作交给webview自己处理  
    
  14.      if (curDomain == null || !isPicUrl(curDomain)) {  
    
  15.          return null;  
    
  16.      }  
    
  17.      if (BuildConfig.DEBUG) {  
    
  18.          Log.d(LOG_TAG, "shouldInterceptRequest url " + request.getUrl().toString());  
    
  19.      }  
    
  20.      //读取当前webview正准备加载URL资源  
    
  21.      String url = request.getUrl().toString();  
    
  22.      try {  
    
  23.         //根据资源url获取一个你要缓存到本地的文件名,一般是URL的MD5  
    
  24.          String resFileName = getResourcesFileName(url);  
    
  25.          if (resFileName == null || "".equals(resFileName)) {  
    
  26.              return null;  
    
  27.          }  
    
  28.         //这里是处理本地缓存的URL,缓存到本地,或者已经缓存过的就直接返回而不去网络进行加载  
    
  29.          this.dvdUrlCache.register(url, getResourcesFileName(url),  
    
  30.                  request.getRequestHeaders().get("Accept"), "UTF-8", DVDUrlCache.ONE_MONTH);  
    
  31.          return this.dvdUrlCache.load(url);  
    
  32.      } catch (Exception e) {  
    
  33.          Log.e(LOG_TAG, "", e);  
    
  34.      }  
    
  35.      return null;  
    
  36.  }  
    

接下来我们看下 DVDUrlCache 的实现:
DVDUrlCache 主要做了这么几件事:
1.封装一个内部类 CacheEntry,做一些基本信息存储

Java 代码 "收藏这段代码")

  1. private static class CacheEntry {
  2.     //用作存储的URL  
    
  3.      public String url;  
    
  4.      //本地保存的文件名称  
    
  5.      public String fileName;  
    
  6.      //标记资源的头部,通过request参数取回  
    
  7.      String mimeType;  
    
  8.      //需要缓存的资源文件的编码  
    
  9.      public String encoding;  
    
  10.      //缓存最大有效时间  
    
  11.      long maxAgeMillis;  
    
  12.      private CacheEntry(String url, String fileName,  
    
  13.                         String mimeType, String encoding, long maxAgeMillis) {  
    
  14.          this.url = url;  
    
  15.          this.fileName = fileName;  
    
  16.          this.mimeType = mimeType;  
    
  17.          this.encoding = encoding;  
    
  18.          this.maxAgeMillis = maxAgeMillis;  
    
  19.      }  
    
  20.  }  
    

接下来是类的构造放方法以及需要映射的 map

Java 代码 "收藏这段代码")

  1. //Key 为 URL
  2. private Map cacheEntries = new HashMap<>();
  3. //缓存路径的根目录
  4.  private File rootDir = null;  
    
  5.  DVDUrlCache() {  
    
  6. //获取本地缓存路径,这个请在调试中自行修改
  7.      this.rootDir = DiskUtil.getDiskCacheDir(DVDApplicationContext.getInstance().getApplicationContext());  
    
  8.  }  
    
  9. //资源注册,参考 DVDWebViewClient 的调用
  10. public void register(String url, String cacheFileName,
  11.                       String mimeType, String encoding,  
    
  12.                       long maxAgeMillis) {  
    
  13.      CacheEntry entry = new CacheEntry(url, cacheFileName, mimeType, encoding, maxAgeMillis);  
    
  14.      this.cacheEntries.put(url, entry);  
    
  15.  }  
    

然后是核心内容

Java 代码 "收藏这段代码")

  1. public WebResourceResponse load(final String url) {
  2.      try {  
    
  3.          final CacheEntry cacheEntry = this.cacheEntries.get(url);  
    
  4.          if (cacheEntry == null) {  
    
  5.              return null;  
    
  6.          }  
    
  7.          final File cachedFile = new File(this.rootDir.getPath() + File.separator + cacheEntry.fileName);  
    
  8.          if (BuildConfig.DEBUG) {  
    
  9.              Log.d(LOG_TAG, "cachedFile is " + cachedFile);  
    
  10.          }  
    
  11.          if (cachedFile.exists() && isReadFromCache(url)) {  
    
  12.              //还没有下载完,在快速切换URL的时候,可能会有很多task并没有及时完成,所以这里需要一个map用于存储正在下载的URL,下载完成后需要移除相应的task  
    
  13.              if (queueMap.containsKey(url)) {                 
    
  14.                  return null;  
    
  15.              }  
    
  16. //过期后直接删除本地缓存内容
  17.              long cacheEntryAge = System.currentTimeMillis() - cachedFile.lastModified();  
    
  18.              if (cacheEntryAge > cacheEntry.maxAgeMillis) {  
    
  19.                  cachedFile.delete();  
    
  20.                  if (BuildConfig.DEBUG) {  
    
  21.                      Log.d(LOG_TAG, "Deleting from cache: " + url);  
    
  22.                  }  
    
  23.                  return null;  
    
  24.              }  
    
  25.              //cached file exists and is not too old. Return file.  
    
  26.              if (BuildConfig.DEBUG) {  
    
  27.                  Log.d(LOG_TAG, url + " ### cache file : " + cachedFile.getAbsolutePath());  
    
  28.              }  
    
  29.              return new WebResourceResponse(  
    
  30.                      cacheEntry.mimeType, cacheEntry.encoding, new FileInputStream(cachedFile));  
    
  31.          } else {  
    
  32.              if (!queueMap.containsKey(url)) {  
    
  33.                  queueMap.put(url, new Callable() {  
    
  34.                      @Override  
    
  35.                      public Boolean call() throws Exception {  
    
  36.                          return downloadAndStore(url, cacheEntry);  
    
  37.                      }  
    
  38.                  });  
    
  39.                  final FutureTask futureTask = ThreadPoolManager.getInstance().addTaskCallback(queueMap.get(url));  
    
  40.                  ThreadPoolManager.getInstance().addTask(new Runnable() {  
    
  41.                      @Override  
    
  42.                      public void run() {  
    
  43.                          try {  
    
  44.                              if (futureTask.get()) {  
    
  45.                                  if (BuildConfig.DEBUG) {  
    
  46.                                      Log.d(LOG_TAG, "remove " + url);  
    
  47.                                  }  
    
  48.                                  queueMap.remove(url);  
    
  49.                              }  
    
  50.                          } catch (InterruptedException | ExecutionException e) {  
    
  51.                              Log.d(LOG_TAG, "", e);  
    
  52.                          }  
    
  53.                      }  
    
  54.                  });  
    
  55.              }  
    
  56.          }  
    
  57.      } catch (Exception e) {  
    
  58.          Log.d(LOG_TAG, "Error reading file over network: ", e);  
    
  59.      }  
    
  60.      return null;  
    
  61.  }  
    
  62. //这个方法是资源下载
  63.  private boolean downloadAndStore(final String url, final CacheEntry cacheEntry)  
    
  64.          throws IOException {  
    
  65.      FileOutputStream fileOutputStream = null;  
    
  66.      InputStream urlInput = null;  
    
  67.      try {  
    
  68.          URL urlObj = new URL(url);  
    
  69.          URLConnection urlConnection = urlObj.openConnection();  
    
  70.          urlInput = urlConnection.getInputStream();  
    
  71.          String tempFilePath = DVDUrlCache.this.rootDir.getPath() + File.separator + cacheEntry.fileName + ".temp";  
    
  72.          File tempFile = new File(tempFilePath);  
    
  73.          fileOutputStream = new FileOutputStream(tempFile);  
    
  74.          byte[] buffer = new byte[1024];  
    
  75.          int length;  
    
  76.          while ((length = urlInput.read(buffer)) > 0) {  
    
  77.              fileOutputStream.write(buffer, 0, length);  
    
  78.          }  
    
  79.          fileOutputStream.flush();  
    
  80.          File lastFile = new File(tempFilePath.replace(".temp", ""));  
    
  81.          boolean renameResult = tempFile.renameTo(lastFile);  
    
  82.          if (!renameResult) {  
    
  83.              Log.w(LOG_TAG, "rename file failed, " + tempFilePath);  
    
  84.          }  
    
  85. // Log.d(LOG_TAG, "Cache file: " + cacheEntry.fileName + " stored. ");
  86.          return true;  
    
  87.      } catch (Exception e) {  
    
  88.          Log.e(LOG_TAG, "", e);  
    
  89.      } finally {  
    
  90.          if (urlInput != null) {  
    
  91.              urlInput.close();  
    
  92.          }  
    
  93.          if (fileOutputStream != null) {  
    
  94.              fileOutputStream.close();  
    
  95.          }  
    
  96.      }  
    
  97.      return false;  
    
  98.  }  
    
  99.  private boolean isReadFromCache(String url) {  
    
  100.      return true;  
    
  101.  }  
    

完整的 DVDURLCache 代码,方便大家直接 copy

Java 代码 "收藏这段代码")

  1. package com.davdian.seller.util.WebUtil;
  2. import android.util.Log;
  3. import android.webkit.WebResourceResponse;
  4. import com.davdian.seller.BuildConfig;
  5. import com.davdian.seller.global.DVDApplicationContext;
  6. import com.davdian.seller.util.DiskUtil;
  7. import com.davdian.seller.util.ThreadPoolManager;
  8. import java.io.*;
  9. import java.net.URL;
  10. import java.net.URLConnection;
  11. import java.util.HashMap;
  12. import java.util.LinkedHashMap;
  13. import java.util.Map;
  14. import java.util.concurrent.Callable;
  15. import java.util.concurrent.ExecutionException;
  16. import java.util.concurrent.FutureTask;
  17. /**
    • 只缓存图片的自定义接口
    • Created by hongminghuangfu on 16/9/3.
  18. */
  19. public class DVDUrlCache {
  20.  private static final String LOG_TAG = "DVDUrlCache";  
    
  21.  private static final long ONE_SECOND = 1000L;  
    
  22.  private static final long ONE_MINUTE = 60L * ONE_SECOND;  
    
  23.  static final long ONE_HOUR = 60 * ONE_MINUTE;  
    
  24.  static final long ONE_DAY = 24 * ONE_HOUR;  
    
  25.  static final long ONE_MONTH = 30 * ONE_DAY;  
    
  26.  private static final LinkedHashMap> queueMap = new LinkedHashMap<>();  
    
  27.  private static class CacheEntry {  
    
  28.      public String url;  
    
  29.      public String fileName;  
    
  30.      String mimeType;  
    
  31.      public String encoding;  
    
  32.      long maxAgeMillis;  
    
  33.      private CacheEntry(String url, String fileName,  
    
  34.                         String mimeType, String encoding, long maxAgeMillis) {  
    
  35.          this.url = url;  
    
  36.          this.fileName = fileName;  
    
  37.          this.mimeType = mimeType;  
    
  38.          this.encoding = encoding;  
    
  39.          this.maxAgeMillis = maxAgeMillis;  
    
  40.      }  
    
  41.  }  
    
  42.  private Map cacheEntries = new HashMap<>();  
    
  43.  private File rootDir = null;  
    
  44.  DVDUrlCache() {  
    
  45. //本地缓存路径,请在调试中自行修改
  46.      this.rootDir = DiskUtil.getDiskCacheDir(DVDApplicationContext.getInstance().getApplicationContext());  
    
  47.  }  
    
  48.  public void register(String url, String cacheFileName,  
    
  49.                       String mimeType, String encoding,  
    
  50.                       long maxAgeMillis) {  
    
  51.      CacheEntry entry = new CacheEntry(url, cacheFileName, mimeType, encoding, maxAgeMillis);  
    
  52.      this.cacheEntries.put(url, entry);  
    
  53.  }  
    
  54.  public WebResourceResponse load(final String url) {  
    
  55.      try {  
    
  56.          final CacheEntry cacheEntry = this.cacheEntries.get(url);  
    
  57.          if (cacheEntry == null) {  
    
  58.              return null;  
    
  59.          }  
    
  60.          final File cachedFile = new File(this.rootDir.getPath() + File.separator + cacheEntry.fileName);  
    
  61.          if (BuildConfig.DEBUG) {  
    
  62.              Log.d(LOG_TAG, "cachedFile is " + cachedFile);  
    
  63.          }  
    
  64.          if (cachedFile.exists() && isReadFromCache(url)) {  
    
  65.              //还没有下载完  
    
  66.              if (queueMap.containsKey(url)) {                  
    
  67.                  return null;  
    
  68.              }  
    
  69.              long cacheEntryAge = System.currentTimeMillis() - cachedFile.lastModified();  
    
  70.              if (cacheEntryAge > cacheEntry.maxAgeMillis) {  
    
  71.                  cachedFile.delete();  
    
  72.                  if (BuildConfig.DEBUG) {  
    
  73.                      Log.d(LOG_TAG, "Deleting from cache: " + url);  
    
  74.                  }  
    
  75.                  return null;  
    
  76.              }  
    
  77.              //cached file exists and is not too old. Return file.  
    
  78.              if (BuildConfig.DEBUG) {  
    
  79.                  Log.d(LOG_TAG, url + " ### cache file : " + cachedFile.getAbsolutePath());  
    
  80.              }  
    
  81.              return new WebResourceResponse(  
    
  82.                      cacheEntry.mimeType, cacheEntry.encoding, new FileInputStream(cachedFile));  
    
  83.          } else {  
    
  84.              if (!queueMap.containsKey(url)) {  
    
  85.                  queueMap.put(url, new Callable() {  
    
  86.                      @Override  
    
  87.                      public Boolean call() throws Exception {  
    
  88.                          return downloadAndStore(url, cacheEntry);  
    
  89.                      }  
    
  90.                  });  
    
  91.                  final FutureTask futureTask = ThreadPoolManager.getInstance().addTaskCallback(queueMap.get(url));  
    
  92.                  ThreadPoolManager.getInstance().addTask(new Runnable() {  
    
  93.                      @Override  
    
  94.                      public void run() {  
    
  95.                          try {  
    
  96.                              if (futureTask.get()) {  
    
  97.                                  if (BuildConfig.DEBUG) {  
    
  98.                                      Log.d(LOG_TAG, "remove " + url);  
    
  99.                                  }  
    
  100.                                  queueMap.remove(url);  
    
  101.                              }  
    
  102.                          } catch (InterruptedException | ExecutionException e) {  
    
  103.                              Log.d(LOG_TAG, "", e);  
    
  104.                          }  
    
  105.                      }  
    
  106.                  });  
    
  107.              }  
    
  108.          }  
    
  109.      } catch (Exception e) {  
    
  110.          Log.d(LOG_TAG, "Error reading file over network: ", e);  
    
  111.      }  
    
  112.      return null;  
    
  113.  }  
    
  114.  private boolean downloadAndStore(final String url, final CacheEntry cacheEntry)  
    
  115.          throws IOException {  
    
  116.      FileOutputStream fileOutputStream = null;  
    
  117.      InputStream urlInput = null;  
    
  118.      try {  
    
  119.          URL urlObj = new URL(url);  
    
  120.          URLConnection urlConnection = urlObj.openConnection();  
    
  121.          urlInput = urlConnection.getInputStream();  
    
  122.          String tempFilePath = DVDUrlCache.this.rootDir.getPath() + File.separator + cacheEntry.fileName + ".temp";  
    
  123.          File tempFile = new File(tempFilePath);  
    
  124.          fileOutputStream = new FileOutputStream(tempFile);  
    
  125.          byte[] buffer = new byte[1024];  
    
  126.          int length;  
    
  127.          while ((length = urlInput.read(buffer)) > 0) {  
    
  128.              fileOutputStream.write(buffer, 0, length);  
    
  129.          }  
    
  130.          fileOutputStream.flush();  
    
  131.          File lastFile = new File(tempFilePath.replace(".temp", ""));  
    
  132.          boolean renameResult = tempFile.renameTo(lastFile);  
    
  133.          if (!renameResult) {  
    
  134.              Log.w(LOG_TAG, "rename file failed, " + tempFilePath);  
    
  135.          }  
    
  136. // Log.d(LOG_TAG, "Cache file: " + cacheEntry.fileName + " stored. ");
  137.          return true;  
    
  138.      } catch (Exception e) {  
    
  139.          Log.e(LOG_TAG, "", e);  
    
  140.      } finally {  
    
  141.          if (urlInput != null) {  
    
  142.              urlInput.close();  
    
  143.          }  
    
  144.          if (fileOutputStream != null) {  
    
  145.              fileOutputStream.close();  
    
  146.          }  
    
  147.      }  
    
  148.      return false;  
    
  149.  }  
    
  150.  private boolean isReadFromCache(String url) {  
    
  151.      return true;  
    
  152.  }  
    
  153. }

ThreadPoolManager 很简单:

Java 代码 "收藏这段代码")

  1. package com.davdian.seller.util;
  2. import android.util.Log;
  3. import java.util.concurrent.Callable;
  4. import java.util.concurrent.ExecutorService;
  5. import java.util.concurrent.Executors;
  6. import java.util.concurrent.FutureTask;
  7. /**
    • 线程池
    • Created by hongminghuangfu on 16/9/9.
  8. */
  9. public class ThreadPoolManager {
  10.  private static final String LOG_TAG = "ThreadPoolManager";  
    
  11.  private static final ThreadPoolManager instance = new ThreadPoolManager();  
    
  12.  private ExecutorService threadPool = Executors.newFixedThreadPool(100);  
    
  13.  public static ThreadPoolManager getInstance() {  
    
  14.      return instance;  
    
  15.  }  
    
  16.  /** 
    
  17.   * @param runnable 不返回执行结果的异步任务 
    
  18.   */  
    
  19.  public void addTask(Runnable runnable) {  
    
  20.      try {  
    
  21.          if (runnable != null) {  
    
  22.              threadPool.execute(runnable);  
    
  23.          }  
    
  24.      } catch (Exception e) {  
    
  25.          Log.e(LOG_TAG, "", e);  
    
  26.      }  
    
  27.  }  
    
  28.  /** 
    
  29.   * @param callback 异步任务 
    
  30.   * @return 你可以获取相应的执行结果 
    
  31.   */  
    
  32.  public FutureTask addTaskCallback(Callable callback) {  
    
  33.      if (callback == null) {  
    
  34.          return null;  
    
  35.      } else {  
    
  36.          FutureTask futureTask = new FutureTask<>(callback);  
    
  37.          threadPool.submit(futureTask);  
    
  38.          return futureTask;  
    
  39.      }  
    
  40.  }  
    
  41. // 这是一个 demo,如果你看不懂,可以打开跑一下
  42. // public static void main(String args[]) {
  43. // FutureTask ft = ThreadPoolManager.getInstance().addTaskCallback(new Callable() {
  44. // @Override
  45. // public Object call() throws Exception {
  46. // int sum = 0;
  47. // for (int i = 0; i < 1000; i++) {
  48. // sum++;
  49. // }
  50. // return sum;
  51. // }
  52. // });
  53. // try {
  54. // System.out.println("执行结果是:" + ft.get());
  55. // } catch (InterruptedException | ExecutionException e) {
  56. // e.printStackTrace();
  57. // }
  58. //
  59. // }
  60. }
  • Android

    Android 是一种以 Linux 为基础的开放源码操作系统,主要使用于便携设备。2005 年由 Google 收购注资,并拉拢多家制造商组成开放手机联盟开发改良,逐渐扩展到到平板电脑及其他领域上。

    333 引用 • 323 回帖 • 66 关注
  • Java

    Java 是一种可以撰写跨平台应用软件的面向对象的程序设计语言,是由 Sun Microsystems 公司于 1995 年 5 月推出的。Java 技术具有卓越的通用性、高效性、平台移植性和安全性。

    3168 引用 • 8207 回帖

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...
  • 被你的图片骗进来了。为嘛要用图片打那么多的星呢? emoji 多好,还好看。 ⭐️ 🌟

推荐标签 标签

  • Oracle

    Oracle(甲骨文)公司,全称甲骨文股份有限公司(甲骨文软件系统有限公司),是全球最大的企业级软件公司,总部位于美国加利福尼亚州的红木滩。1989 年正式进入中国市场。2013 年,甲骨文已超越 IBM,成为继 Microsoft 后全球第二大软件公司。

    103 引用 • 126 回帖 • 446 关注
  • flomo

    flomo 是新一代 「卡片笔记」 ,专注在碎片化时代,促进你的记录,帮你积累更多知识资产。

    3 引用 • 80 回帖 • 2 关注
  • TensorFlow

    TensorFlow 是一个采用数据流图(data flow graphs),用于数值计算的开源软件库。节点(Nodes)在图中表示数学操作,图中的线(edges)则表示在节点间相互联系的多维数据数组,即张量(tensor)。

    20 引用 • 19 回帖
  • 设计模式

    设计模式(Design pattern)代表了最佳的实践,通常被有经验的面向对象的软件开发人员所采用。设计模式是软件开发人员在软件开发过程中面临的一般问题的解决方案。这些解决方案是众多软件开发人员经过相当长的一段时间的试验和错误总结出来的。

    198 引用 • 120 回帖
  • 互联网

    互联网(Internet),又称网际网络,或音译因特网、英特网。互联网始于 1969 年美国的阿帕网,是网络与网络之间所串连成的庞大网络,这些网络以一组通用的协议相连,形成逻辑上的单一巨大国际网络。

    96 引用 • 330 回帖
  • 阿里巴巴

    阿里巴巴网络技术有限公司(简称:阿里巴巴集团)是以曾担任英语教师的马云为首的 18 人,于 1999 年在中国杭州创立,他们相信互联网能够创造公平的竞争环境,让小企业通过创新与科技扩展业务,并在参与国内或全球市场竞争时处于更有利的位置。

    43 引用 • 221 回帖 • 238 关注
  • Ant-Design

    Ant Design 是服务于企业级产品的设计体系,基于确定和自然的设计价值观上的模块化解决方案,让设计者和开发者专注于更好的用户体验。

    17 引用 • 23 回帖 • 3 关注
  • jQuery

    jQuery 是一套跨浏览器的 JavaScript 库,强化 HTML 与 JavaScript 之间的操作。由 John Resig 在 2006 年 1 月的 BarCamp NYC 上释出第一个版本。全球约有 28% 的网站使用 jQuery,是非常受欢迎的 JavaScript 库。

    63 引用 • 134 回帖 • 741 关注
  • 游戏

    沉迷游戏伤身,强撸灰飞烟灭。

    169 引用 • 799 回帖
  • Quicker

    Quicker 您的指尖工具箱!操作更少,收获更多!

    20 引用 • 74 回帖 • 1 关注
  • Telegram

    Telegram 是一个非盈利性、基于云端的即时消息服务。它提供了支持各大操作系统平台的开源的客户端,也提供了很多强大的 APIs 给开发者创建自己的客户端和机器人。

    5 引用 • 35 回帖
  • CSS

    CSS(Cascading Style Sheet)“层叠样式表”是用于控制网页样式并允许将样式信息与网页内容分离的一种标记性语言。

    180 引用 • 447 回帖
  • 房星科技

    房星网,我们不和没有钱的程序员谈理想,我们要让程序员又有理想又有钱。我们有雄厚的房地产行业线下资源,遍布昆明全城的 100 家门店、四千地产经纪人是我们坚实的后盾。

    6 引用 • 141 回帖 • 562 关注
  • V2EX

    V2EX 是创意工作者们的社区。这里目前汇聚了超过 400,000 名主要来自互联网行业、游戏行业和媒体行业的创意工作者。V2EX 希望能够成为创意工作者们的生活和事业的一部分。

    17 引用 • 236 回帖 • 418 关注
  • Tomcat

    Tomcat 最早是由 Sun Microsystems 开发的一个 Servlet 容器,在 1999 年被捐献给 ASF(Apache Software Foundation),隶属于 Jakarta 项目,现在已经独立为一个顶级项目。Tomcat 主要实现了 JavaEE 中的 Servlet、JSP 规范,同时也提供 HTTP 服务,是市场上非常流行的 Java Web 容器。

    162 引用 • 529 回帖 • 4 关注
  • 外包

    有空闲时间是接外包好呢还是学习好呢?

    26 引用 • 232 回帖 • 6 关注
  • 小薇

    小薇是一个用 Java 写的 QQ 聊天机器人 Web 服务,可以用于社群互动。

    由于 Smart QQ 从 2019 年 1 月 1 日起停止服务,所以该项目也已经停止维护了!

    34 引用 • 467 回帖 • 691 关注
  • Shell

    Shell 脚本与 Windows/Dos 下的批处理相似,也就是用各类命令预先放入到一个文件中,方便一次性执行的一个程序文件,主要是方便管理员进行设置或者管理用的。但是它比 Windows 下的批处理更强大,比用其他编程程序编辑的程序效率更高,因为它使用了 Linux/Unix 下的命令。

    122 引用 • 73 回帖
  • Caddy

    Caddy 是一款默认自动启用 HTTPS 的 HTTP/2 Web 服务器。

    10 引用 • 54 回帖 • 127 关注
  • 数据库

    据说 99% 的性能瓶颈都在数据库。

    330 引用 • 614 回帖
  • 反馈

    Communication channel for makers and users.

    123 引用 • 906 回帖 • 193 关注
  • Linux

    Linux 是一套免费使用和自由传播的类 Unix 操作系统,是一个基于 POSIX 和 Unix 的多用户、多任务、支持多线程和多 CPU 的操作系统。它能运行主要的 Unix 工具软件、应用程序和网络协议,并支持 32 位和 64 位硬件。Linux 继承了 Unix 以网络为核心的设计思想,是一个性能稳定的多用户网络操作系统。

    915 引用 • 931 回帖
  • HHKB

    HHKB 是富士通的 Happy Hacking 系列电容键盘。电容键盘即无接点静电电容式键盘(Capacitive Keyboard)。

    5 引用 • 74 回帖 • 407 关注
  • ZooKeeper

    ZooKeeper 是一个分布式的,开放源码的分布式应用程序协调服务,是 Google 的 Chubby 一个开源的实现,是 Hadoop 和 HBase 的重要组件。它是一个为分布式应用提供一致性服务的软件,提供的功能包括:配置维护、域名服务、分布式同步、组服务等。

    59 引用 • 29 回帖 • 21 关注
  • 运维

    互联网运维工作,以服务为中心,以稳定、安全、高效为三个基本点,确保公司的互联网业务能够 7×24 小时为用户提供高质量的服务。

    148 引用 • 257 回帖 • 1 关注
  • Wide

    Wide 是一款基于 Web 的 Go 语言 IDE。通过浏览器就可以进行 Go 开发,并有代码自动完成、查看表达式、编译反馈、Lint、实时结果输出等功能。

    欢迎访问我们运维的实例: https://wide.b3log.org

    30 引用 • 218 回帖 • 605 关注
  • 宕机

    宕机,多指一些网站、游戏、网络应用等服务器一种区别于正常运行的状态,也叫“Down 机”、“当机”或“死机”。宕机状态不仅仅是指服务器“挂掉了”、“死机了”状态,也包括服务器假死、停用、关闭等一些原因而导致出现的不能够正常运行的状态。

    13 引用 • 82 回帖 • 38 关注