Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Cache problem

I'm making my website in Adobe Muse (I know about EOL, please don't point to that).

The problem is, even after publishing the changes, they aren't immediately reflected by the browser. I have to clear cache and only then, the changes show up. The thing is, I can keep clearing cache to see the changes, but, I can't keep telling my users to keep clearing cache to view my site.

Also, I've used this code in :
which I found out by searching on Google. I also read that it's not much of use and yeah, it indeed isn't much of use.

The other thing I read about is versioning i.e., I can add ?v1.1 or something like that in js and css so that browser loads the thing from the source and not from cache. But, I don't really want to add that to every js and css file. It's time consuming for me.

Even in CloudFlare, I have set browser cache expiration time as 30 mins. (that's the minimum value available there). I don't really know if the cache is expiring after 30 mins. or no because I need to see how my website is looking immediately after I publish it, so, I can't wait for 30 mins. to check it. Also, I can use the preview function in Adobe Muse, but there are some scripts which only load when the browser's address bar is showing my domain. So, I need to preview my website in the published state itself. And yeah, just to mention, the problem isn't with CloudFlare cache as when I clear my cache, the website is reflecting the changes.

Also, there's this one thing I read somewhere that servers can also set the cache time in browsers, something like that. I don't remember quite well, but, it basically meant that browser's cache expiration can also depend on server's configuration.

So, I want to know, if it's just my website that's suffering from this issue, or are other website suffering too? Is the server configuration thing true? And if it's just my website, what can I do to prevent browser from loading my website from its cache? Or is something wrong with Muse if anyone has any clue about it?

Any help will be appreciated. Thank you.

Comments

  • It's really sure that you've not very well understood the problem. I can't be telling my users to disable their cache. I need a solution about that.

  • were u using IE cause IE is quite broken for me I think cause now too I am using IE11

    Can you please a bit briefly tell your problem with more specific?

    But if you are thinking why IE is always showing ?i=1 then up to ?i=3 and then redirects you to some support for cookie thingy.
    Then I may help you with that!

  • Of course I'm not using IE! I'm using Chrome! And after all that explanation, I don't know how much more I can explain the problem. I can tell you to just read the whole thing once, maybe? No offence, okay?

    MY problem basically is that, my I am not able to see the changes that I'm publishing to my website without clearing my browser's cache.

    And the ?i=1, dude, just read the topic once. I know the cookie thing, what I was talking is called versioning. Never mind.

  • oh okay...

    May I see a screenshot of your website right now?
    And tell me your domain and I will see it in comparison about your website when u visit it and on my Browser when I visit it

  • Well, as of now, my site's looking fine. It's here: brokenhearts.ml My described problem usually occurs when I use some external scripts like the web push notification script, or the comment script. It doesn't update as soon as I publish my website. I'll post when the problem reoccurs. As of now, my browser's cache is clear and there are no new scripts that I can include, so, I can't reproduce the problem sadly.

  • @VPHrishikesh said:
    Well, as of now, my site's looking fine. It's here: brokenhearts.ml My described problem usually occurs when I use some external scripts like the web push notification script, or the comment script. It doesn't update as soon as I publish my website. I'll post when the problem reoccurs. As of now, my browser's cache is clear and there are no new scripts that I can include, so, I can't reproduce the problem sadly.

    I see you're using Cloudflare on that domain. Cloudflare provides many speed benefits to websites, but largely relies on cache to do so. You can't have a website which immediately updates when you push new content which is fast around the world as well. It's a tradeoff.

    When actively developing your website, try setting Cloudflare to "Development Mode" so Cloudflare doesn't cache your site anymore.

  • edited April 6

    @Admin
    Yeah, but as I said, I don't really think it's CloudFlare issue as when I'm clearing the cache of my browser I'm able to see the changes. So, it's probably not CloudFlare's cache that's causing the problem, it's the cache of my browser.

  • @VPHrishikesh said:
    @Admin
    Yeah, but as I said, I don't really think it's CloudFlare issue as when I'm clearing the cache of my browser I'm able to see the changes. So, it's probably not CloudFlare's cache that's causing the problem, it's the cache of my browser.

    Cloudflare also tells your browser it should cache stuff (again, because it generally helps browsing experience), and Development Mode might disable that as well. So I do think Cloudflare is partly responsible for the cache.

  • @Admin

    Okay. Thanks for that info. I'll surely try out with Development mode.

  • edited April 7

    I have asked CloudFlare about this issue, but, till they reply, I just want to know something they had mentioned in thier support articles.

    They say that, no matter what value you set as browser cache expiration time, if the server has a configuration of the time more than you've set, CloudFlare will respect it. Basically, I have set browser cache expiration time as 30 mins and even after 1 full day, I'm unable to see the changes without clearing my cache.

    Quoted from CloudFlare: The Browser Cache Expiration specifies how long cached files will remain in your visitor’s browser cache. This expiration time is what Cloudflare will set unless longer time periods are specified at your web server.

    So, does InfinityFree have any server configuration for browser cache expiration thing so that I can mention in my ticket that it's not a problem from my server?

  • @VPHrishikesh said:
    I have asked CloudFlare about this issue, but, till they reply, I just want to know something they had mentioned in thier support articles.

    They say that, no matter what value you set as browser cache expiration time, if the server has a configuration of the time more than you've set, CloudFlare will respect it. Basically, I have set browser cache expiration time as 30 mins and even after 1 full day, I'm unable to see the changes without clearing my cache.

    Quoted from CloudFlare: The Browser Cache Expiration specifies how long cached files will remain in your visitor’s browser cache. This expiration time is what Cloudflare will set unless longer time periods are specified at your web server.

    So, does InfinityFree have any server configuration for browser cache expiration thing so that I can mention in my ticket that it's not a problem from my server?

    I spoke a bit too soon. By default, the free hosting servers also send caching headers which tell browsers to cache static content (like CSS and JS) for a month. To disable it, you can add these lines to your .htaccess file:

    Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
    Header set Pragma "no-cache"
    Header set Expires "Wed, 11 Jan 1970 00:00:00 GMT"
    

    But for the record: caching is a good thing and you should enable it wherever possible. Disabling browser cache will lead to longer page load times and more account resource usage. Don't disable cache unless you absolutely need to.

  • Okay. Thank you for that info. So, just 2 more things:

    1) If needed, do I just have to copy-paste the code as it is at the end of my current .htaccess?

    2) Does this tell browser to reload resources from the server or do the users have to clear their cache first?

  • @VPHrishikesh said:
    Okay. Thank you for that info. So, just 2 more things:

    1) If needed, do I just have to copy-paste the code as it is at the end of my current .htaccess?

    I don't think it really matters where in the .htaccess file this code is. You can put it wherever you want.

    @VPHrishikesh said:
    2) Does this tell browser to reload resources from the server or do the users have to clear their cache first?

    This code tells browsers that they should not cache any of the files they download. However, files which are already in cache will stay in cache until they expire or are cleared.

    If you insist on forcing browsers to expunge their cache right now, you could trick them into redownloading the files by adding some extra query parameters to the URL.

  • Okay. Thank you for the help!

This discussion has been closed.