首页 > 其他分享 >清楚缓存_使用github进行数据缓存

清楚缓存_使用github进行数据缓存

时间:2022-12-08 18:58:15浏览次数:34  
标签:GitHub like URL 使用 github 缓存 清楚 your

Most people are aware of using GitHub as an easy tool to collaborate on coding projects, but few even realize that you can use it as a data storage and caching system — for free.

大多数人都知道使用GitHub作为在编码项目上进行协作的简便工具,但是很少有人意识到您可以免费将它用作数据存储和缓存系统。

Depending on your use case, this can be a really nice workflow and allow some nice tricks like using static sites with dynamically generated and cached content.

根据您的用例,这可能是一个非常不错的工作流程,并允许使用一些不错的技巧,例如使用具有动态生成和缓存内容的静态网站。

 

使用原始代码URL将GitHub托管的文件作为数据源进行引用 (Reference GitHub-Hosted Files as Data Sources Using Raw Code URLs)

The main idea that stands behind this is quite simple: GitHub offers a raw view for files that can be accessed via a URL and gives you the raw file without any of the “GitHub stuff” around it. So instead of seeing your text or JSON file with all the version history and the GUI to make changes or download, you just get the file itself hosted under that URL.

背后的主要思想很简单:GitHub提供了可通过URL访问的文件的原始视图,并为您提供了没有任何“ GitHub内容”的原始文件。 因此,您无需查看具有所有版本历史记录和GUI进行更改或下载的文本或JSON文件,而只需将文件本身托管在该URL下即可。

The URL looks something like this:

 

 

URL看起来像这样:

https://raw.githubusercontent.com/username/repositoryname/master/filename?token=dsaöjlksdajöldfasjöfa

This URL does not change between builds or commits, which means that you can use it as persistent storage. This is already pretty nifty and can save you from setting up a database on some projects. However, this can be used even better to do caching of all kinds of common requests.

 

 

该URL在生成或提交之间不会更改,这意味着您可以将其用作持久性存储。 这已经很漂亮了,可以避免您在某些项目上建立数据库。 但是,这甚至可以更好地用于缓存各种常见请求。

使用自动任务缓存结果 (Caching Results With an Automated Task)

In essence, you will need a way to automatically commit changes to the repository every so often. This can be stupidly simple with a batch script running on your own machine or a server. Something like this:

本质上,您将需要一种经常自动将更改提交到存储库的方法。 使用在自己的计算机或服务器上运行的批处理脚本,这可能非常简单。 像这样:

 

 

标签:GitHub,like,URL,使用,github,缓存,清楚,your
From: https://www.cnblogs.com/sdfasdf/p/16966970.html

相关文章

  • Github Actions 学习笔记
    GithubActions是什么?GithubActions官方介绍:GitHubActions是一个持续集成和持续交付(CI/CD)平台,允许您自动化构建、测试和部署管道。您可以创建构建和测试存储库中的每......
  • asp.net core 缓存
      一、浏览器缓存服务器如果返回cache-control:max-age=60,则表示服务器通知浏览器端可以缓存这个内容60秒//缓存3秒[ResponseCache(Duration=3)][Htt......
  • Notepad++ ,json 、xml 格式化插件安装不了 和 github 网站访问不了 最佳解决方案
    OverridetheentrypointofanimageIntroducedinGitLabandGitLabRunner9.4.Readmoreaboutthe extendedconfigurationoptions.Beforeexplainingtheav......
  • 用NetCore + ReactJS 实现一个前后端分离的网站 (6) 缓存机制
    1.前言对于实时性要求不高的资源,我们一般可以利用缓存机制来降低数据库的请求压力。轻量级的应用可以用自带的MemoryCache,如果对缓存的高并发、持久化有要求的可以用Red......
  • 用nginx缓存静态文件
      这篇教程说明你应该怎样配置nginx、设置HTTP头部过期时间,用Cache-Control中的max-age标记为静态文件(比如图片、CSS和Javascript文件)设置一个时间,这样用户的......
  • 排查github上有无代码泄露的两大不错的工具
    排查github上有无代码泄露的两大不错的工具,分别是:1)Gitrob(介绍文章:​​http://www.91ri.org/11928.html​​) 2)​​https://github.com/MiSecurity/x-patrol​​  ......
  • 十五、NHibernate之二级缓存
    什么是NHibernate二级缓存​NHibernate二级缓存由ISessionFactory创建,可以被所有的ISession共享。在NHibernate中,当我们启用NHibernate二级缓存。使用ISession进行数据操作......
  • GitHub 远程仓库
    gitgitconfig--globaluser.name"clipboard"gitconfig--globaluser.email"[email protected]"gitconfig--global--listssh-keygen-trsa-b4096-......
  • 017.二级缓存(2)
    1.good.xml(flushCache="true"在sql执行完之后强制清空缓存)<!--flushCache="true"在sql执行完之后强制清空缓存--><selectid="selectGoodsMap"resultType="java......
  • 016.1MyBatis二级缓存(1)
    1.一级缓存和二级缓存  2.缓存的范围  3.二级缓存的运行规则  4.测试一级缓存/***测试一级缓存**@throwsException*/......