Skip to content

Commit

Permalink
Merge pull request #32 from tkgnm/add-workflow-to-cache-urls
Browse files Browse the repository at this point in the history
Add workflow to cache urls
  • Loading branch information
tkgnm authored Aug 27, 2023
2 parents ec6c909 + 006fbfb commit a11f505
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,20 @@ paths=(
"/gallery/8"
)

for path in "${paths[@]}"; do
# Hit the home page first
home_url="$base_url"
echo "Requesting URL: $home_url at $(date +"%Y-%m-%d %H:%M:%S")"
response=$(curl -w "\nTime: %{time_total}\nStatus Code: %{http_code}" "$home_url")
echo -e "$response\n---------------------------------------"

# Wait for 10 seconds
sleep 10s

# Hit the other pages with a 1-second delay
for path in "${paths[@]:1}"; do
url="$base_url$path"
echo "Requesting URL: $url at $(date +"%Y-%m-%d %H:%M:%S")"
response=$(curl -w "\nTime: %{time_total}\nStatus Code: %{http_code}" "$url")
response=$(curl -s -w "\nTime: %{time_total}\nStatus Code: %{http_code}" "$url")
echo -e "$response\n---------------------------------------"
sleep 1s
done

0 comments on commit a11f505

Please sign in to comment.