# php noob - simple cache fix?

**URL:** <https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559>\
**Category:** Uncategorized\
**Created:** [July 8, 2022, 8:25am UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559 "2022-07-08T08:25:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sumpson](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sumpson](https://forum.kirupa.com/u/Sumpson)\
**Post date:** [July 8, 2022, 8:25am UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/1 "2022-07-08T08:25:14Z")

</div>

Hi! We got a custom php calendar for apartment reservations…its working fine but sometimes when I/clients visit the website the calander shows weeks available when they are reserved.  
This seems to be a caching/memory problem, I have tried to add:

```auto
<meta http-equiv="expires" content="Sun, 01 Jan 2014 00:00:00 GMT"/>
<meta http-equiv="pragma" content="no-cache" />

```

in the html header but the problem still exists; is there a quick fix for this problem? You can see the site in action at: [https://oostendezeedijkcentraal.be/](https://oostendezeedijkcentraal.be/)

Hope someone is able to make me happy with an idea on how to fix this problem.

cheers

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [July 8, 2022, 2:08pm UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/2 "2022-07-08T14:08:05Z")

</div>

Does clearing the cache and refreshing the page display the data correctly?

---

<div class="post-metadata">

**Author:** ![Sumpson](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sumpson](https://forum.kirupa.com/u/Sumpson)\
**Post date:** [July 9, 2022, 7:10am UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/3 "2022-07-09T07:10:08Z")

</div>

Thanks for your reply! Yes that works but it needs to be updated automatic for everybody. We don’t want returning visitors to try and make a reservation for dates which are not available.

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [July 9, 2022, 2:28pm UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/4 "2022-07-09T14:28:30Z")

</div>

Gotcha! Add these three lines and see if that fixes it:

```auto
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="0"/>

```

Do you have a CDN associated with the page that may be adding additional caching?

Cheers,  
Kirupa

---

<div class="post-metadata">

**Author:** ![Sumpson](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@Sumpson](https://forum.kirupa.com/u/Sumpson)\
**Post date:** [July 10, 2022, 7:45am UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/5 "2022-07-10T07:45:50Z")

</div>

> [@kirupa](#):
>
> ```auto
> <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
> <meta http-equiv="Pragma" content="no-cache"/>
> <meta http-equiv="Expires" content="0"/>
> 
> ```

I have implemented it, hope this fixes the problem.

thank you so much 🙏

---

<div class="post-metadata">

**Author:** ![kirupa](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kirupa/32/11616_2.png) [@kirupa](https://forum.kirupa.com/u/kirupa)\
**Post date:** [July 10, 2022, 4:43pm UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/6 "2022-07-10T16:43:16Z")

</div>

Good luck! Reply back if it isn’t working, and we can try some alternate solutions 😀

---

<div class="post-metadata">

**Author:** ![thugtomas](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@thugtomas](https://forum.kirupa.com/u/thugtomas)\
**Post date:** [September 30, 2022, 1:48pm UTC](https://forum.kirupa.com/t/php-noob-simple-cache-fix/652559/7 "2022-09-30T13:48:09Z")

</div>

please use WordPress plugin simple cache fix
