P
P
Petr Volkhanov2017-04-19 19:14:29
JavaScript
Petr Volkhanov, 2017-04-19 19:14:29

Improving the PageSpeed ​​score. How to cache data on CDN cloudflare?

Hi all!
Improving PageSpeed ​​score . How to cache data on CDN cloudflare?
Use the browser cache for the following resources:
cdn.ecuras.com/img/main/DnPriceTag.jpg (no expiration date specified)
cdn.ecuras.com/img/main/DnValueRec.jpg (no expiration date specified)
cdn.ecuras.com /img/main/KeyboardCloseupRectangular.jpg (no expiration date)
cdn.ecuras.com/img/main/SeoDemystified.jpg (no expiration date)
cdn.ecuras.com/img/main/WebDesign.jpg (no expiration date ) validity)
cdn.ecuras.com/img/main/Workshop2_Rec.jpg (no expiration date)
cdn.ecuras.com/img/main/WorkspaceRectangular.jpg (no expiration date)
cdn.ecuras.com/img/main/WritingInDiaryRectangular.jpg (no expiration date specified)
How to cache data on CDN cloudflare? How can I do this, who faced?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Anton Spirin, 2018-04-30
@rockon404

var trouble = +prompt('What is wrong?');

var CABEL = 1;
var ROUTER = 2;
var COMPUTER = 3;

switch (trouble) {
  case CABEL:
    console.log('check your cabel');
    break;
  
  case ROUTER:
    console.log('check your router');
    break;
  
  case COMPUTER:
    console.log('reload your PC');
    break;
  
  default:
    console.log('uncorrect trouble');
}

S
Stimulate, 2018-04-30
@Stimulate

var trouble = prompt('What is wrong?');

switch (trouble) {
  case 1:
    console.log('check your cabel');
    break;
  
  case 2:
    console.log('check your router');
    break;
  
  case 3:
    console.log('reload your PC');
    break;
  
  default:
    console.log('uncorrect trouble');
  break;
}

C
Codebaker, 2018-04-30
@Codebaker

1) prompt returns strings, comparison with numbers is incorrect
2) in blocks with if ()... you constantly compare with constants, although a little earlier they declared their "semantic load"
Accordingly, it would be better to do this:
1) var trouble = parseInt (prompt('What is wrong?'))
2) if (trouble == cabel) {...
...
else if (trouble == router) { ...
...
else if (trouble == computer) { ....

E
eRKa, 2018-04-30
@kttotto

Your code works for me
here
And in general, you should not neglect ";" at the end of the line.

D
Dimonchik, 2017-04-19
@dimonchik2013

https://habrahabr.ru/post/245165/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question