jalogut / magento2-deployer-plus

Tool based on deployer.org to perform zero downtime deployments of Magento 2 projects
GNU General Public License v3.0
200 stars 59 forks source link

Add {{magento_dir}}/pub/static/_cache to shared/writable/clear_paths #12

Closed osrecio closed 6 years ago

osrecio commented 6 years ago

Add path /pub/static/_cache to Shared, Writable and Clear Paths.

When you have a multi-stage server and merged css or js this folder and subfolders are created to distribute css & js and you need to have it shared.

Added to clear paths because in each deploy we clean old files that will no longer be used.

jalogut commented 6 years ago

Hi @osrecio

Sorry but I do not completely understand the issue here. If you do not share this _cache, each server will create their own, right? Is that a problem or it is just performance. So the _cache is only created once and then available for all others?

osrecio commented 6 years ago

Actually the problem is: Server 1 -> This server receives a request and create the js and css cache and url will change to: store.com/pub/static/_cache/merged/1df1a823136ce6816cefe2f78dcdb61a.min.js Server 2 -> The file: /pub/static/_cache/merged/1df1a823136ce6816cefe2f78dcdb61a.min.js doesn't exist. Therefore it will not find it unless the folder is shared Server 3 -> The file: /pub/static/_cache/merged/1df1a823136ce6816cefe2f78dcdb61a.min.js doesn't exist. Therefore it will not find it unless the folder is shared.

each server will create their own, right?

Nope, the first server that recieve the request will create these files.

So the _cache is only created once and then available for all others?

Is correct, the folder merged inside of _cache is actually the problem. You should share, but can be a good chance to share _cache.

I hope it's clear now.

jalogut commented 6 years ago

Ok fair enough! Thanks

jalogut commented 6 years ago

@osrecio It seems that there are conflicts. I cannot do anything until tuesday, so feel free to fix them and create a new tag. I just added you as collaborator

osrecio commented 6 years ago

I will resolve conflicts tomorrow. Thanks for give me a new role 😄