Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable caching in htaccess #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Enable caching in htaccess #3

wants to merge 5 commits into from

Conversation

fussel178
Copy link
Member

No description provided.

@fussel178 fussel178 added the enhancement New feature or request label Jun 12, 2020
@fussel178 fussel178 requested a review from pklaschka June 12, 2020 00:51
@fussel178 fussel178 self-assigned this Jun 12, 2020
Copy link
Member

@pklaschka pklaschka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, great work. There are a few concerns here and there (as aggressive caching can be -- shall we say -- annoying), other than that, I think it looks good 🙂

.htaccess Outdated Show resolved Hide resolved
.htaccess Outdated Show resolved Hide resolved
Comment on lines +60 to +62
Header set Cache-Control "max-age=2678400, public"
</filesmatch>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the above comment regarding image caching

Copy link
Member Author

@fussel178 fussel178 Jun 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, please correct if I am wrong, but for files with endings *.ico/*.jpg/... we set a header control instruction with max-age of 1 month (60s * 60m * 24h * 31d = 2678400s). Is that not the same caching time span as in mod_expires above?

.htaccess Outdated Show resolved Hide resolved
Ludwig Richter and others added 3 commits June 12, 2020 09:49
Co-authored-by: Pablo Klaschka <pklaschka@users.noreply.github.com>
Co-authored-by: Pablo Klaschka <pklaschka@users.noreply.github.com>
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this will, by default, affect HTML caching. I'll have to check that later...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It affects the expiration time for all documents if not specified by ExpiresByType (see Apache Module mod_expires#ExpiresDefault)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, we have to check how this affects the dynanic content in different browsers. If a browser caches the movie index page for a month without revalidatung it, that wouldn't be good.

@fussel178 fussel178 requested a review from pklaschka June 12, 2020 10:02
Copy link
Member

@pklaschka pklaschka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the previous comments 😜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants