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

Set browser caching for static resources #278

Closed
luboskmetko opened this issue Oct 2, 2017 · 6 comments · Fixed by #346
Closed

Set browser caching for static resources #278

luboskmetko opened this issue Oct 2, 2017 · 6 comments · Fixed by #346
Assignees

Comments

@luboskmetko
Copy link
Member

luboskmetko commented Oct 2, 2017

CSS, scripts, images, etc.

@luboskmetko luboskmetko self-assigned this Oct 2, 2017
@luboskmetko luboskmetko changed the title Set browser caching for static resources like CSS, scripts, images Set browser caching for static resources Oct 24, 2017
@marcinkrzeminski
Copy link
Collaborator

Hi,

@luboskmetko do you mean using .htaccess with mod_expiers and friends? I could do that. Let me know if I should work on that.

@luboskmetko
Copy link
Member Author

Hi Marcin,

yes, could be something simple like here https://varvy.com/pagespeed/leverage-browser-caching.html but I would set caching for CSS/JS for 1 year as we have files revisioning. You can also take a look at .htaccess generated by WP Rocket, they have more advanced version with more file types covered.

Reassigning to you, thanks!

@marcinkrzeminski
Copy link
Collaborator

Hi @luboskmetko ,

finally found the time to work on this. You think we should do this only for WP projects or both types?

@marcinkrzeminski
Copy link
Collaborator

Hi again,

I just pushed some code for the WP project only. Here's the code: https://github.com/xfiveco/generator-chisel/compare/master...marcinkrzeminski:feature-278?diff=split&expand=1&name=feature-278

I have taken most of it from https://github.com/h5bp/html5-boilerplate/blob/6.0.1/dist/.htaccess. It worked for me in the past pretty well.

I did some tests on my local and the expiration time is respected as per .htaccess file.

@luboskmetko
Copy link
Member Author

@marcinkrzeminski thanks and sorry for the late reply. It looks good to me, can you please create a PR?

@marcinkrzeminski
Copy link
Collaborator

I just did a PR ;).

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

Successfully merging a pull request may close this issue.

2 participants