@davy_yg Using npm is probably a better move.
Installing bower component
I heard to self host jquery and bootstrap there is an easy way that is by installing bower component:
ref: https://bower.io/
It's depracated - does it means the next version of bootstrap and jquery won't be registered in bower any longer ?
https://bower.io/docs/creating-packages/#bowerjson
Should I use bower to install the components ?
Or installing them using npm is better ?
@fylzero How do you call the reference of node modules:
<script src="{{ url('node_modules/jquery/dist/jquery.min.js') }}"></script>
<script src="{{ url('node_modules/jquery/dist/jquery.slim.min.js') }}"></script>
<link rel="stylesheet" href="{{ url('node_modules/bootstrap/dist/css/bootstrap.min.css') }}">
<link rel="stylesheet" href="{{ url('node_modules/bootstrap/dist/js/bootstrap.min.js') }}">
<link rel="stylesheet" href="{{ url('node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css') }}">
<link rel="stylesheet" href="{{ url('node_modules/@fortawesome/fontawesome-free/css/all.css') }}">
Here is an example. I checked the file is actually there! It's in node_modules folder not in public folder. I only wonder how to call the files ?
@davy_yg node modules folder should not be publically accessible. So, NO not this way
@Snapey Then, how to reference to the files that I created with npm ? (jquery, bootstrap & fontawesome)
@davy_yg Open the documentation and try to search...
@davy_yg If you want to, just use the .copy function in your Laravel mix config to move the dist files to the /public/js and /public/css directories. That was as you update packages and run npm, your dist files will be updated as well.
@fylzero I also have question about versioning .version( ) which is to cache my js ( which is save memory or to speed up ? ) that is only valid for custom js right ?
@davy_yg If you compile all your css and javascript into one css and one js file then it's valid for all your css and javascript.
@davy_yg version() is for cache busting your css and js files when you build, aka add new code. It is only useful if you wrap your file refs in mix() when calling them in Blade. I would suggest always using this so you don't constantly need to shift refresh your browser during development.... and so clients don't have to do the same when you update your styles and js code.
@davy_yg When, one day, you become a web developer you will learn that browsers cache things, and that is not always what you want.
Or just download the files from the cdn you are using and place them in your public/css and public/js directories.
I tried to self host my bootstrap, font awesome and jquery but I get an E GTMetrix Grade afterwards:
https://gtmetrix.com/reports/staging.orderblind.com/IVO1BOZD/
I get a B earlier with CDN lol. Any idea why ?
@davy_yg because your server is slow to get to from canada? Wheras CDN (which will ALWAYS be faster) is distributed around the world.
https://gtmetrix.com/reports/staging.orderblind.com/th7DN1V8/
Here is my latest test get a C on GTMetrix.
Serve static assets with an efficient cache policy
ref: https://gtmetrix.com/serve-static-assets-with-an-efficient-cache-policy.html
How to set cache policy to 1 year on the server ? I am using share hosting.
I am using share hosting.
Then why are you worrying about performance. In that statement you just said " i don't care about performance "
use a CDN it will be much faster and they already set the correct cache policy
The website is quite small for me to host it in a dedicated or cloud server that's why I host it in share hosting.
I already use CDN and still get a C: https://gtmetrix.com/reports/staging.orderblind.com/th7DN1V8/
I forget what I did why it turns into a B back in the past for no reason.
@davy_yg you should be focused on
Total Page Requests - 1059
I don't understand what this means: Total Page Requests - 1059
1059 people are trying to access it in the same time ?
@davy_yg no it means it took 1059 requests to load your page !
https://www.jobstreet.co.id/en/
And please exclude Computer/Information Techology
@MichalOravec Lol. that's the only thing I can do, besides UI UX.
@davy_yg And the reason is?
@MichalOravec No reason. I simply have invested a lot of time in it.
@davy_yg And what?
Programming is not for you... at least stop asking stupid questions every day.
@MichalOravec dude, I asked these kinds of questions even in other fields. I have to progress otherwise I won't learn anything.
@davy_yg In which fields?
@MichalOravec graphic design
@davy_yg Exclude Computer / Information Technology jobs.
What don't you understand?
@MichalOravec I don't plan to apply for another job. I worked for my clients building websites!
@davy_yg Then work and don't ask stupid questions here every day.
@MichalOravec You are a guy?
======================
See I thought this community / forum can be a support system, that's why it exist!
before you bother with metrics tools, you should just open the developer tools, click on the network tab and see what a monster you have created;
- 1367 requests
- 12.0MB Transferred
- 162MB Resources
- Finish 2.3 Minutes
@Snapey I think because of the multiple youtubes makes things slows!
The google ads also comes from:
that I put multiple youtube video in it.
I think I am considering youtube auto play perhaps.
ref: https://developers.google.com/youtube/iframe_api_reference#Example_Video_Player_Constructors
I only wonder how to put the list of youtube videos that I want to play in the script ?
Please or to participate in this conversation.