contao / manager-bundle

[READ-ONLY] Contao Manager Bundle
GNU Lesser General Public License v3.0
17 stars 10 forks source link

[RTM] Automatically cache assets forever #73

Closed Toflar closed 6 years ago

Toflar commented 6 years ago

All our thumbnails contain hashes so the files can be cached forever by the clients as in case it is updated, the path will change. I think it would be a great addition to automatically add the caching headers so everything inside assets/images is cached forever (aka 1 year).

aschempp commented 6 years ago

I generally like the idea, but didn't we agree in https://github.com/contao/manager-bundle/pull/58 not to have caching defaults in the .htaccess file? If images already have a long caching period in the server configuration, these lines would be useless and unnecessary to parse…

Toflar commented 6 years ago

Default configuration generally has no caching headers at all. And these lines are everything else but "useless" because assets/images can be cached for 1 year. files/whatever cannot. So your general caching setting would certainly not be 1 year but a lot lower.

aschempp commented 6 years ago

Well it was 1 month in your previous PR (https://github.com/contao/manager-bundle/pull/58/files#diff-384ec441f8200771c47307a594c0d63eR141), which we could not know either. Just saying…

Toflar commented 6 years ago

In this case we know that we can cache for 1 year. So it's not "useless" and this PR has nothing to do with the other one at all. Just saying...

leofeyer commented 6 years ago

I generally like the idea, but didn't we agree in #58 not to have caching defaults in the .htaccess file?

We sure did and to me this is the same case.

we agreed on providing an example configuration in the docs and adding a link to it in the .htaccess file.

Toflar commented 6 years ago

Can we have that up for discussion again? It‘s a really bad idea not to provide sensible defaults.

leofeyer commented 6 years ago

If you really want another heated discussion, here you go. However, the arguments have not changed at all, so expect the same conclusion as last time.

leofeyer commented 6 years ago

As discussed in Mumble on July 5th, we did not come to the same conclusion as last time. 😄

fritzmg commented 6 years ago

Soo... we get defaults? 😁

Toflar commented 6 years ago

RTM

Toflar commented 6 years ago

Just to summarize for everybody why this PR was accepted, contrary to the other one:

Also just a note for anybody: If you really do care about all this stuff. Make sure your provider supports stuff like mod_pagespeed that will automatically optimize a lot for you and use tools such as Cloudflare and Co.

This PR is mainly just a simple improvement for smaller sites that don't have any of those tools.

leofeyer commented 6 years ago

Thank you @Toflar.