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

Leverage browser caching / h5bp basic config #800

Closed
5 of 6 tasks
strarsis opened this issue Mar 25, 2017 · 8 comments
Closed
5 of 6 tasks

Leverage browser caching / h5bp basic config #800

strarsis opened this issue Mar 25, 2017 · 8 comments

Comments

@strarsis
Copy link
Contributor

strarsis commented Mar 25, 2017

Submit a feature request or bug report


Related to old PR discussion/comment #37 (comment) .

Google PageSpeed Insights recommends (and gives a higher score for)
leveraging browser caching, notably for static files.

Trellis already uses h5bp nginx server config and it also offers
basic configuration, useful for static files, notably expiry.

Note: Including this extra config can cause some side effects with the PHP related routing, see https://github.com/h5bp/server-configs-nginx/blob/master/doc/common-problems.md.

@swalkinshaw
Copy link
Member

The original concern was that we can't guarantee assets that are included on a page contain cache busting information.

I guess if anyone uses the wp_enqueue methods, then they contain the version by default? Not entirely sure how trust worthy this is, or if we can assume people alway use those functions or some other method.

@mAAdhaTTah
Copy link
Contributor

I guess if anyone uses the wp_enqueue methods, then they contain the version by default?

Yes, version of WP if nothing is set, otherwise the string provided to the version parameter.

@swalkinshaw
Copy link
Member

Should be noted that anyone can add this config by using Nginx include/child templates.

@strarsis
Copy link
Contributor Author

Are there any plans for adding this in near future? It is also a handy way improving the PageSpeed score.

@swalkinshaw
Copy link
Member

Nope. My original concern still stands and this can easily be done by anyone that needs it.

@strarsis
Copy link
Contributor Author

strarsis commented Apr 14, 2017

One way to solve this could be by using a plugin that enforces adding the necessary
cache busting parameter to all resources like Busted .

@swalkinshaw
Copy link
Member

Seems useful but Trellis can't depend on a specific WP plugin.

@strarsis
Copy link
Contributor Author

strarsis commented Apr 14, 2017

I agree with this and include the h5bp config file myself.

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

No branches or pull requests

3 participants