Cache

From BC$ MobileTV Wiki
Revision as of 12:49, 26 February 2022 by Bcmoney (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A cache is a temporary storage file intended to speed up an application or service.


Specifications


Cache Architectures

[1]


Network-side

DNS cache

DNS Caching occurs when top-level DNS servers hold on to a mapping of popular (commonly visited) and/or recently visited domain names and their corersponding IPv4/IPv6 address ranges.


Load Balancer

Reverse Proxy

Caching at the Load Balancer level.


Cloud

CDN cache

On top of just loading content quickly, there are regional differences in content connection speeds (ISP quality), network routes (for legal/political reasons, etc), blocking/monitoring (i.e. political reasons). For that reason, in serving traffic globally it is often most performant and sometimes legally optimal to use a CDN with data centers within the countries/sub-regions you officially do business.

Cloud-based App cache

Short of or in collaboration with a full file-level CDN, a Cloud-based Caching platform such as Hazelcast Cloud or any of the equivalent Cloud platforms’ caching mechanisms (AWS, Azure, GCP, etc) may be leveraged by an application, rather than relying solely on its own self-hosted or internal caching mechanism(s) to improve performance of its data retrieval.


Server-side

Web Service cache

As in a common web server layer deployed on top of a slower application stack that can render pages dynamically but may not be as efficient for serving content quickly (aka. a Dispatcher, or "web optimization" server).

Sidecar

Microservice-level cache.

Application cache

Application Cache is held in-memory for the lifetime of an application (until the next restart, or based on some internal expiry policy or caching mechanism).


Client-side

Browser Cache

Client-side caching happens in the user's browser.

 <meta http-equiv="cache-control" content="max-age=0" />
 <meta http-equiv="cache-control" content="no-cache" />
 <meta http-equiv="pragma" content="no-cache" />

[2] [3] [4] [5]

Expires

Example "expires" headers used to set refresh intervals for specific pages, content or entire web applications:

 <http-equiv="expires" content="0" />
 <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />

BlurHash

A lazy loading image caching companion technique to show a gradient color that matches/approximates the image in place of an actual image until It has loaded. This is particularly useful in Mobile Applications or any applications that need to load large image assets remotely/externally through a network connection.

[6]



Resources


Tutorials

[14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]



External Links


References

  1. Where Is My Cache? Architectural Patterns for Caching Microservices: https://dzone.com/articles/where-is-my-cache-architectural-patterns-for-cachi
  2. Using <meta> tags to turn off caching in all browsers?: https://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers
  3. Useful HTML Meta Tags: www.i18nguy.com/markup/metatags.html
  4. What is the meaning of the html tag HTTP-EQUIV "CACHE-CONTROL": https://www.metatags.org/meta_http_equiv_cache_control
  5. Different kinds of caches: https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching
  6. Java - Generate BlurHash Examples: https://www.woolha.com/tutorials/java-generate-blurhash-examples
  7. setDoInput and setDoOutput in Java HttpURLConnection: https://stackoverflow.com/questions/5583064/setdoinput-and-setdooutput-in-java-httpurlconnection
  8. Adding header for HttpURLConnection: https://stackoverflow.com/questions/12732422/adding-header-for-httpurlconnection
  9. How to modify the header of a HttpUrlConnection: https://stackoverflow.com/questions/480153/how-to-modify-the-header-of-a-httpurlconnection
  10. How does EhCache work in a clustered environment: https://www-01.ibm.com/support/docview.wss?uid=swg21519527
  11. Using ehcache and verifying that it works with JPA and springframework: https://www.gridshore.nl/2008/04/29/using-ehcache-and-verifying-that-it-works-with-jpa-and-springframework/
  12. Ehcache - A Java Distributed Cache: http://highscalability.com/ehcache-java-distributed-cache
  13. What is Ehcache in Java?: https://www.quora.com/What-is-Ehcache-in-Java?share=1
  14. What is JCache?: https://redisson.org/glossary/jcache.html
  15. JCache RI - note that the reference implementation should not be used in PROD: https://github.com/jsr107/RI (missing tiered storage & distributed caching)
  16. Introduction to JCache (JSR 107): https://dzone.com/articles/introduction-jcache-jsr-107
  17. Apache Ignite (data grid) - OSS JCache provider: t
  18. Apache Ignite - JCache and Beyond: https://apacheignite.readme.io/docs/jcache
  19. Apache Camel - JCache component: https://camel.apache.org/components/latest/jcache-component.html
  20. Oracle Coherence - JCache: https://www.oracle.com/middleware/technologies/coherence.html
  21. Oracle Coherence - Working with JCache: https://docs.oracle.com/middleware/1213/coherence/tutorial/jcache.htm
  22. Hazelcast - Java Cache implementation: https://hazelcast.com/glossary/jcache-java-cache/
  23. Terracotta - EH Cache: http://www.terracotta.org/terracotta-ehcache/
  24. Infinispan - JCache: https://infinispan.org/

See Also

PHP | Java | AJAX | JavaScript | CSS | Image | Optimization | CDN