[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EP-tech] auto-X.Y.Z.css



Hi John and Yuri,

This is the bane of my life as well, having to tell users to make sure 
they "hard refresh" the page before complaining something is not 
appearing/working as expected.? So having a fix for this will save me a 
lot of back and forth because I can be confident caching is not an issue.

Therefore, I have created this GitHub issue:

https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Feprints%2Feprints3.4%2Fissues%2F220&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=dUcNsO8RkOEpmOAqa4TpjA6VzgXnreX2mdf5jQXrxd8%3D&reserved=0

I have half written this already, it should not take too long to 
complete but may take a while to test to be confident it will do the job.

Regards

David Newman

On 28/04/2022 5:29 pm, John Salter wrote:
> *CAUTION:* This e-mail originated outside the University of Southampton.
>
> As a (hopefully useful) side note, the Apache Rewrite ruleset will 
> honour URLs for the auto css and javascript that match e.g.
>
> style/auto-3.3.10.css
>
> style/auto-3.3.101.css
>
> style/auto-3.3.10999.css
>
> style/auto-3.3.100000.css
>
> - any amount of digits (but only digits) before the '.css' or '.js'.
>
> This can be used to force newer versions of the auto- files into browsers.
>
> For recent versions of EPrints, I think you can copy 
> lib/cfg.d/template_core.pl into the archive config file.
>
> I would suggest changing this line:
>
> href => $repo->current_url( path => "static", 
> "style/auto-".EPrints->human_version.".css" ),
>
> to:
>
> href => $repo->current_url( path => "static", 
> "style/auto-".EPrints->human_version."1.css" ), #note '1' before '.css'
>
> Next time you need to force a different auto CSS or JS file, update 
> the digit, or remove it!
>
> For older versions of EPrints (3.3.10, possibly beyond), where the 
> loading of config files from various different directories worked a 
> little differently, and overriding files from lib/cfg.d/ wasn't as 
> simple as copying them to the local config, you could make a lovely 
> hack, intercepting the template pins and adding extra digits to them:
>
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fc5ae75d8cbafb902af8299ec57101d8c&data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=hCS4pe7SmcunQ5nFGfEQ5BF1MytS31N5E0wRP341OT4%3D&reserved=0 
> <https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgist.github.com%2Fjesusbagpuss%2Fc5ae75d8cbafb902af8299ec57101d8c&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=hCS4pe7SmcunQ5nFGfEQ5BF1MytS31N5E0wRP341OT4%3D&amp;reserved=0>
>
> I'm not /recommending/ the above hack - but we had it running like 
> that without incident on 3.3.10 for a number of years!
>
> Cheers,
>
> John
>
> *From:*eprints-tech-bounces at ecs.soton.ac.uk 
> [mailto:eprints-tech-bounces at ecs.soton.ac.uk] *On Behalf Of *David R 
> Newman via Eprints-tech
> *Sent:* 28 April 2022 16:50
> *To:* eprints-tech at ecs.soton.ac.uk; Yuri <yurj at alfa.it>
> *Subject:* Re: [EP-tech] auto-X.Y.Z.css
>
> Hi Yuri,
>
> This is in lib/cfg.d/template_core.pl.? This file may also be in your 
> archive's cfg/cfg.d/ directory or possibly even the 
> flavours/pub_lib/cfg.d/ directory if you are on 3.4.
>
> This is the block of code you need to update (around line 39):
>
> ?$head->appendChild( $repo->xml->create_element( "link",
> ??????????? rel => "stylesheet",
> ??????????? type => "text/css",
> ??????????? href => $repo->current_url( path => "static", 
> "style/auto-".EPrints->human_version.".css" ),
> ??????? ) );
>
> Regards
>
> David Newman
>
> On 28/04/2022 4:41 pm, Yuri via Eprints-tech wrote:
>
>     CAUTION: This e-mail originated outside the University of Southampton.
>
>     Hi!
>
>      ? where's the code/template that generates the link in the head to
>
>     auto-X.Y.Z.css? I've modified it, but it is cached in the browser for a
>
>     month. I need to change it in order to people to get the changes without
>
>     asking them to clear the cache.
>
>     Thanks!
>
>     *** Options:http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmailman.ecs.soton.ac.uk%2Fmailman%2Flistinfo%2Feprints-tech&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=489JrjJppvsGo5PFlGeadoqslecM%2F38X%2F6n%2FoFig%2BcI%3D&amp;reserved=0>
>
>     *** Archive:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=cCW7MAV1rX2qfLrOeJ1jIiyV%2FwUIj7lhndeDWqMfX1A%3D&amp;reserved=0!  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=cCW7MAV1rX2qfLrOeJ1jIiyV%2FwUIj7lhndeDWqMfX1A%3D&amp;reserved=0>
>
>     AiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=qD%2Bac2q85kHMQ9C%2FngNKXI03jrGh0s52kqxiJefoXQs%3D&amp;reserved=0
>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.eprints.org%2Ftech.php%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=cCW7MAV1rX2qfLrOeJ1jIiyV%2FwUIj7lhndeDWqMfX1A%3D&amp;reserved=0>
>
>     *** EPrints community wiki:https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=OaErZEhQULQfj4XvrHVyP53T%2F8ZzAap4dPgMeWaBjiA%3D&amp;reserved=0!  <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=OaErZEhQULQfj4XvrHVyP53T%2F8ZzAap4dPgMeWaBjiA%3D&amp;reserved=0>
>
>     uMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=Mjmd7ryQW69R5WYd6mS%2FU5JtKGpw%2FU3rB6EXpf8xMKE%3D&amp;reserved=0
>     <https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwiki.eprints.org%2F&amp;data=05%7C01%7Ceprints-tech%40ecs.soton.ac.uk%7C5787f63e6e54476065cd08da2935880a%7C4a5378f929f44d3ebe89669d03ada9d8%7C0%7C0%7C637867607130000078%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=OaErZEhQULQfj4XvrHVyP53T%2F8ZzAap4dPgMeWaBjiA%3D&amp;reserved=0>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20220428/951280fc/attachment-0001.html