Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache-control header... maybe #72

Merged
merged 2 commits into from
Nov 6, 2024
Merged

Conversation

GvandeSteeg
Copy link
Contributor

No description provided.

@GvandeSteeg GvandeSteeg requested a review from HarryHung November 5, 2024 15:18
@GvandeSteeg GvandeSteeg self-assigned this Nov 5, 2024
Copy link
Collaborator

@HarryHung HarryHung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with PHP, I assume this alter the Cache Control behaviour of the PHP server?

Do you want this line to be part of the HTML when the webpage is loaded? In CRA React app src/index.html is ignored, the actual HTML being loaded is public/index.html. So you will need to add this line to public/index.html, and it will become part of the built website.

For example the analytic Javascript is added this way:

<script type="text/javascript" src="/zxtm/piwik2.js"></script>

@GvandeSteeg
Copy link
Contributor Author

GvandeSteeg commented Nov 6, 2024

I am not familiar with PHP, I assume this alter the Cache Control behaviour of the PHP server?

Do you want this line to be part of the HTML when the webpage is loaded? In CRA React app src/index.html is ignored, the actual HTML being loaded is public/index.html. So you will need to add this line to public/index.html, and it will become part of the built website.

For example the analytic Javascript is added this way:

<script type="text/javascript" src="/zxtm/piwik2.js"></script>

ah cool, thanks Harry. I'll admit I had no idea what to do, just followed some SO thread. I'll put them in public instead. The issue is we still won't know if this will work, nor can we really test it working.

Even though we're many versions of Chrome later, this answer still fixed a problem we were having in development. Also, just to clarify, this header can be added in any web server - it's not PHP specific. –
Randall
CommentedSep 28, 2018 at 16:31

@GvandeSteeg GvandeSteeg requested a review from HarryHung November 6, 2024 12:08
Copy link
Collaborator

@HarryHung HarryHung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-11-06 at 12 20 08

I can confirm the PHP code is inserted to the web app now.

@HarryHung
Copy link
Collaborator

I am not familiar with PHP, I assume this alter the Cache Control behaviour of the PHP server?
Do you want this line to be part of the HTML when the webpage is loaded? In CRA React app src/index.html is ignored, the actual HTML being loaded is public/index.html. So you will need to add this line to public/index.html, and it will become part of the built website.
For example the analytic Javascript is added this way:

<script type="text/javascript" src="/zxtm/piwik2.js"></script>

ah cool, thanks Harry. I'll admit I had no idea what to do, just followed some SO thread. I'll put them in public instead. The issue is we still won't know if this will work, nor can we really test it working.

Even though we're many versions of Chrome later, this answer still fixed a problem we were having in development. Also, just to clarify, this header can be added in any web server - it's not PHP specific. –
Randall
CommentedSep 28, 2018 at 16:31

No worries, I got you.

The worst case scenario is just doing nothing, so I think we shall proceed anyway.

As stated in the linked thread, it seems to be a Chrome-specific issue? Because I use Firefox personally and never notice this behaviour.

If you are happy, I will merge the PR, release, and deploy.

@GvandeSteeg
Copy link
Contributor Author

yes please!

@HarryHung HarryHung merged commit 2b32272 into master Nov 6, 2024
1 check passed
@HarryHung HarryHung deleted the fix/POP-854/add-cache-reset branch November 6, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants