This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

7ala

  • ****
  • 144 posts
When I edit in css files
The modification does not appear on client devices
Unless they delete the cache from their device
And this is a problem
Is there a solution to apply the modifications without deleting the cache
thank you

*

MB Themes

@7ala
Use autogenerated version to stylesheet link.

As example, if you have this link to CSS in your head.php:
Code: [Select]
mysite.com/style.css
Change it to:
Code: [Select]
mysite.com/style.css?v=123213
Where number is always random.
This can be achieved by getting date in numerical format:
Code: [Select]
?v=<?php echo date('YmdHis'); ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
Thank you for your kindness in replying to me
I made the idea of history
I didn't succeed
I make an idea
<link rel="stylesheet" href="<?php echo osc_current_web_theme_url('css/style.css?version=1') ; ?>">
But it has to be modified every time
Better date idea
What is wrong with the code please?
<link rel="stylesheet" href="<?php echo osc_current_web_theme_url('css/style.css?v=<?php echo date('YmdHis'); ?>') ; ?>">

Thank you very much

Marked as best answer by frosticek on July 26, 2021, 11:27:53 AM
*

MB Themes

@7ala
Code: [Select]
<link rel="stylesheet" href="<?php echo osc_current_web_theme_url('css/style.css') ; ?>?v=<?php echo date('YmdHis'); ?>">
« Last Edit: July 26, 2021, 11:27:48 AM by MB Themes »
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

7ala

  • ****
  • 144 posts
@7ala
Code: [Select]
<link rel="stylesheet" href="<?php echo osc_current_web_theme_url('css/style.css) ; ?>?v=<?php echo date('YmdHis'); ?>">

Thank you for your kindness in replying to me
Now it only works, there was a missing comma for the code
Thanks
Code: [Select]
<link rel="stylesheet" href="<?php echo osc_current_web_theme_url('css/style.css') ; ?>?v=<?php echo date('YmdHis'); ?>">
« Last Edit: July 24, 2021, 02:56:03 PM by 7ala »