summaryrefslogtreecommitdiff
path: root/_posts/2020-05-17-why-is-browser-caching-so-weird.md
blob: adfc5427091d981614d372f1a29b42edc4e8c44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
---
layout: post
title: Why is browser caching so weird?
date: 2020-05-17 18:02 +0200
tags: jekyll, webdev
categories: tech
---

I wondered for a while about this... Every time I added an entry to my blog, regenerated
and reuploaded it... When I typed `blog.uvokchee.de` in my browser, it would open the old
index.html. I had to manually refresh (Ctrl-R / F5, not even Ctrl-Shift-R to circumvent
the cache) the page so it displayed the new entry. This confuses me utterly.

Up until now, no headers were sent by the server except `ETags`. So... what is the default
browser caching behavior? I'm glad about any input about that.

For now, I added this to `.htaccess`, lets see if this helps. \*shrugs\*

```
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 week"
ExpiresByType text/html "access plus 0 seconds"
</IfModule>
```