How to clear PHP (Server cache)?

Username: epiz_29193525


So I made an PHP page with like/dislike function. It changes the icon color when interaction(Font awesome), and using heart icon , but the older version of the icon (thumbs-up) always appear (this was the older version’s icon)

Code snippet (if needed)

<a class="card-link <?php IF ($isPostLiked) { echo "dislikePost"; } else { echo "likePost";}?>" id="like_<?php echo  $post['post_id']; ?>" data-post-id="<?php echo $post['post_id']; ?>">
				<i style="cursor: pointer; <?php IF ($isPostLiked) { echo "color: red;"; } else { echo "color: black;";}?>" title="<?php IF ($isPostLiked) { echo "Liked"; } else { echo "Like";}?>" id="likeIcon_<?php echo  $post['post_id']; ?>" class="<?php IF ($isPostLiked) { echo "fas fa-heart"; } else { echo "fas fa-heart";}?>"></i></a>

I tried…

I tried to clear device/browser cache, and tried on another device, but nothing(So its server cache). Also tried in Cpanel, but there isn’t a function to clear caches or temp files. If anyone can help, I will be very happy…

Can you provide a domain?

1 Like

This may help…

1 Like

Yes, but login requied :confused:

So if I use this, my domain gets suspended? :confused:

Can you create a temp account for us? Your ISP may also be caching, so try on a cellular network.

1 Like

Is possible if website is resource intensive

1 Like

We don’t cache things on the server. If you’re not using HTTPS, your network operator or ISP may be doing caching too (but that’s quite rare).

I strongly recommend against setting the .htaccess rules proposed. They don’t control server cache, they are just headers sent to browsers to instruct them how to cache things. But if browser cache has been ruled out, changing the caching headers has no effects.

Did you check the generated HTML output to check the result of the PHP code? Did it set the right CSS classes and other HTML attributes?


Okay, I will try it. Thanks to you all very much!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.