Inquiry Regarding Cache Control Settings for My Website

I hope this message finds you well. My name is Rinta, and I am a customer of your web hosting services. I am writing to inquire about the possibility of configuring cache control settings for my website.

I have encountered an issue where the content on my website is not updating as expected on user devices, particularly when accessed from mobile phones. It appears that the caching mechanism is causing delays in reflecting the latest changes.

I understand that you may have restrictions on editing .htaccess files, but I am interested in implementing cache control headers or any suitable method to ensure that the website content is always served in its most up-to-date state.

Could you please provide guidance on how I can achieve this? If there are any server-side settings or alternatives to .htaccess that I can utilize to manage cache control, I would greatly appreciate your assistance in configuring them correctly.

Thank you for your attention to this matter, and I look forward to your response. If you require any additional information or access to my account for further assistance, please do not hesitate to let me know.

Best regards,

I use this on my websites to disable server-side caching. Iā€™m not aware if it works on this InfinityFree platform but you are welcome to try:

<IfModule mod_headers.c>
    Header set Cache-Control "no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires 0
</IfModule>

<FilesMatch "\.(css|flv|gif|htm|html|ico|jpe|jpeg|jpg|js|mp3|mp4|png|pdf|swf|txt)$">
    <IfModule mod_expires.c>
        ExpiresActive Off
    </IfModule>
    <IfModule mod_headers.c>
        FileETag None
        Header unset ETag
        Header unset Pragma
        Header unset Cache-Control
        Header unset Last-Modified
        Header set Pragma "no-cache"
        Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
        Header set Expires "Thu, 1 Jan 1970 00:00:00 GMT"
    </IfModule>
</FilesMatch>
1 Like

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