Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Hard Caching in TYPO3 - Developer Days in Malmø 2017

597 Aufrufe

Veröffentlicht am

You should know who caches what and how to cache it. There are so many aspects to consider. Bottomline: You need to know your system and what you are doing!

Veröffentlicht in: Technologie
  • Als Erste(r) kommentieren

  • Gehören Sie zu den Ersten, denen das gefällt!

Hard Caching in TYPO3 - Developer Days in Malmø 2017

  1. 1. Hard Caching Follow me on Twitter @bennimack
  2. 2. About myself • Cache Grinder • Cash Cow • Cage Conversion Rater • Performance Performer
  3. 3. Pronouncing Cache CashKasch Cache /ˈkæʃ/ = Käsch Cage Casché Cach Czech Katsching
  4. 4. Caching in a nutshell • Caching is bad • Not caching is even worse • Clearing your caches is a workaround • Clear your caches - or... know what you're doing
  5. 5. Why does it matter?
  6. 6. It becomes my problem Client changes something in TYPO3, change does not show in the frontend vs. Client complains the site is slow
  7. 7. Why should we cache?
  8. 8. Why should we cache • Serve data faster that other needs lot of processing, memory, IO • Saves the environment! Saves lives! • Main issue: Get it under control
  9. 9. Caches everywhere • CDN • Browser caches • Server caches • PHP caches • TYPO3 caches • Database caches • Memory caches
  10. 10. CDN
  11. 11. Browser Cache Request /products/game-boy-retro/ Response: Valid for 24h Cache-Control: public
 E-Tag: 7eac52c37675360243068dffc49e9351
 Expires: 24hs
  12. 12. Browser Cache - 2nd time Request /products/game-boy-retro/ Response: You already have it ("ETag")
  13. 13. Browser Cache Request /products/secret-weapon/ Response: You only get it now Cache-Control: private
 Pragma: no-cache
  14. 14. Browser Cache Request /products/secret-weapon/ Response: You only get it now Cache-Control: private
 Pragma: no-cache
  15. 15. Browser Cache Request /products/secret-weapon/ Response
  16. 16. Things can change • Clear your browser cache? • Not the problem in the first place • Ensure that your browser knows what to cache
  17. 17. Things can change • Just add the tstamp so the browser caches different variants <link rel="stylesheet" type="text/css"
 href="/typo3conf/ext/site_for_drevil/Resources/ Public/Css/main.css?1499248117">
  18. 18. Developers?
  19. 19. First Hit vs. Cached Hit
  20. 20. TYPO3 Cache - First Hit Request /products/pampers/ Response Heavy lifting
  21. 21. TYPO3 Cache - Second Hit Request /products/pampers/ Response Done here
  22. 22. About cHash • Variant of the page that gets a separate cache entry • Depends on the additional GET variants • Some parameters can be excluded in TYPO3
  23. 23. no no no_cache=1
  24. 24. Remember: Save .env
  25. 25. Some things should never be cached
  26. 26. 10 minutes 1 day - 7 daysno_cache! 2 minutes
  27. 27. Caching Framework
  28. 28. Caching Framework - Backends • APC • Database • Filesystem (NFS, HDD, SDD) • Redis, Memcached
  29. 29. Caching Framework - Part 2 • cache_core (PHP code = files) • cache_hash • cache_pages • cache_pagesection • cache_rootline
  30. 30. Caching Framework - Part 3 • fluid_template (It's PHP = Files) • extbase_object (Small => APCu) • extbase_reflection (Small => APCu) • extbase_datamapfactory_datamap (Small => APCu)
  31. 31. Lessons learned • Fix the issue, not the symptom • Save the environment • Don't cache forever, it will bite you • Know your system, what it does • Never use no_cache=1
  32. 32. Go and save goats ... and don't forget to follow me on twitter @bennimack

×