Multiple websites are there in the single instance of aws EC2. Only one website is live and it loads very slow for the first time and next time it is faster, How to make faster the first time! I am a fresher. thanks in advance
Asked
Active
Viewed 1,205 times
0
-
1It sounds like the website gets cached after the first load. However other services caches pages and show them to other users if they load the same page (example varnish -> https://aws.amazon.com/marketplace/pp/B01H2063F6). Normally somewhere in the settings you can add a crone job that caches your pages at night so they load fast the first time – Wimanicesir Sep 20 '18 at 14:19
1 Answers
0
@Wimanicesir is absolutely right.
With e.g. chrome developer console (press f12 to open) you can select the network tab und check what takes so long to load. If you want to make a whole reload (to simulate the first load) press Ctrl+F5 instead of F5. You should be able to see if there are huge images or other files - there you can try to compress them (e.g. jpgs -> lower quality) or loading them dynamically after page load via AJAX.
if the page load itself takes long, check your PHP code - this could help you there Start and stop a timer PHP
if you've found code parts or database requests which takes pretty long, feel free to post the code / information if you don't know how to fix it.

Fanamy
- 51
- 5