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

Hash generation from relative path instead of absolute #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Hash generation from relative path instead of absolute #141

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 3, 2017

I think that generating hashes from relative path instead of absolute path would allow more usages of this library.

For example, I am working on a website made with Grav CMS, and there's lots of images generation, so first page loads takes lots times (scaling, transforming images etc..). Before deploying in production, I want to ensure that every image has been generated and compiled (to not make the prod verrrry slooww), it does execute php -S ... and crawl all the pages with wget -r ... then doing a rsync the images/ directory from local to prod.

But because the absolute path is used, the pre-generated images on local won't be used by prod. Prod having as base path something like /opt/sflx/live/ and the local have something like /home/dctremblay/Containers/SFLxNG/build/live. If relative path is used instead of absolute, this trick would work. The commit introduces this fix.

If you have further questions do not hesitate, thank you very much and have a great day !

I think that generating hashes from relative path instead of absolute path would allow more usages of this library.

For example, I am working on a website made with Grav CMS, and there's lots of images generation, so first page loads takes lots times (scaling, transforming images etc..). Before deploying in production, I want to ensure that every image has been generated and compiled (to not make the prod verrrry slooww), it does execute `php -S ...` and crawl all the pages with `wget -r ...` then doing a `rsync` the `images/` directory from local to prod.

But because the absolute path is used, the pre-generated images on local won't be used by prod. Prod having as base path something like `/opt/sflx/live/` and the local have something like `/home/dctremblay/Containers/SFLxNG/build/live`. If relative path is used instead of absolute, this trick would work. The commit introduces this fix.

If you have further questions do not hesitate, thank you very much and have a great day !
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

Successfully merging this pull request may close these issues.

0 participants